Initial commit

This commit is contained in:
Stone-Red-Code
2021-04-16 10:11:38 +02:00
commit 86324a7cd7
72 changed files with 13205 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
using System;
using AlwaysUpToDate;
namespace AlwaysUpToDate_Test
{
internal class Program
{
static private Updater downloader = new Updater(new TimeSpan(0, 0, 1), "https://raw.githubusercontent.com/Stone-Red-Code/Test/main/test.json", "./", false);
private static void Main(string[] args)
{
downloader.Start();
downloader.ProgressChanged += Downloader_ProgressChanged;
downloader.UpdateAvailible += Downloader_UpdateAvailible;
Console.ReadLine();
}
private static void Downloader_UpdateAvailible(string version, string additionalInformationUrl)
{
Console.WriteLine("New Update: " + version);
downloader.Update();
}
private static void Downloader_ProgressChanged(long? totalFileSize, long totalBytesDownloaded, double? progressPercentage)
{
Console.WriteLine($"{totalBytesDownloaded}/{totalFileSize} {progressPercentage}%");
}
}
}