Files
DotNetAlpm/Samples/Program.cs
2020-04-29 13:21:13 -04:00

40 lines
1.1 KiB
C#

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();
}
}
}