checkpoint
This commit is contained in:
39
Samples/Program.cs
Normal file
39
Samples/Program.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Immutable;
|
||||
using Foodsoft.Alpm;
|
||||
|
||||
namespace Samples
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Other()
|
||||
{
|
||||
using var h = new Handle("/", "/home/luebsj/db");
|
||||
using var db = h.RegisterSyncDB("jkl-repo", SigLevel.SIG_PACKAGE_OPTIONAL | SigLevel.SIG_USE_DEFAULT);
|
||||
|
||||
db.AddServer("http://arch.johnluebs.com/x86_64");
|
||||
db.Update(false);
|
||||
foreach (var a in db.Servers)
|
||||
{
|
||||
Console.WriteLine("Hello {0}", a);
|
||||
}
|
||||
|
||||
var servers = db.Servers;
|
||||
var b = new string[3];
|
||||
var l = db.Servers.ToImmutableList();
|
||||
|
||||
using var cache = db.PackageCache;
|
||||
foreach ( var p in cache) using(p)
|
||||
{
|
||||
Console.WriteLine("Hello: {0} {1} {2}", p.Name, p.Filename, p.BuildDate);
|
||||
}
|
||||
|
||||
Console.WriteLine("Hello World! {0} {1} {2}", db.Name, API.Version,
|
||||
l[0]);
|
||||
}
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Other();
|
||||
}
|
||||
}
|
||||
}
|
||||
12
Samples/Samples.csproj
Normal file
12
Samples/Samples.csproj
Normal file
@@ -0,0 +1,12 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Alpm\Alpm.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user