checkpoint

This commit is contained in:
2020-04-29 13:10:17 -04:00
parent c1618deb83
commit 64f7dd4b7d
54 changed files with 294 additions and 263 deletions

39
Samples/Program.cs Normal file
View 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
View 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>