Skip to content

Commit 2566e73

Browse files
committed
refactor: Reconstruct the entire structure
The old code was refactored and new syntax was added
1 parent 69a18a6 commit 2566e73

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1825
-1408
lines changed
Lines changed: 82 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,89 @@
1-
namespace GeneralUpdate.Client
1+
using System.Text;
2+
using GeneralUpdate.ClientCore;
3+
using GeneralUpdate.Common.Download;
4+
using GeneralUpdate.Common.Internal;
5+
using GeneralUpdate.Common.Internal.Bootstrap;
6+
using GeneralUpdate.Common.Shared.Object;
7+
8+
namespace GeneralUpdate.Client
29
{
3-
internal class Program
10+
internal class Progra
411
{
512
private static void Main(string[] args)
613
{
7-
14+
/*Task.Run(async () =>
15+
{
16+
var source = @"D:\packet\app";
17+
var target = @"D:\packet\release";
18+
var patch = @"D:\packet\patch";
19+
20+
await DifferentialCore.Instance?.Clean(source, target, patch);
21+
await DifferentialCore.Instance?.Dirty(source, patch);
22+
});*/
23+
24+
/*Task.Run(() =>
25+
{
26+
var configinfo = new Configinfo();
27+
configinfo.UpdateLogUrl = "https://www.baidu.com";
28+
configinfo.ReportUrl = "http://127.0.0.1:5008/Upgrade/Report";
29+
configinfo.UpdateUrl = "http://127.0.0.1:5008/Upgrade/Verification";
30+
31+
configinfo.AppName = "GeneralUpdate.Upgrade";
32+
configinfo.MainAppName = "GeneralUpdate.Client";
33+
configinfo.InstallPath = Thread.GetDomain().BaseDirectory;
34+
35+
configinfo.ClientVersion = "1.0.0.0";
36+
configinfo.UpgradeClientVersion = "1.0.0.0";
37+
38+
configinfo.Platform = 1;
39+
configinfo.ProductId = "9999";
40+
configinfo.AppSecretKey = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
41+
42+
_ = new GeneralClientBootstrap()//单个或多个更新包下载通知事件
43+
.AddListenerMultiDownloadProgress(OnMultiDownloadProgressChanged)
44+
//单个或多个更新包下载速度、剩余下载事件、当前下载版本信息通知事件
45+
.AddListenerMultiDownloadStatistics(OnMultiDownloadStatistics)
46+
//单个或多个更新包下载完成
47+
.AddListenerMultiDownloadCompleted(OnMultiDownloadCompleted)
48+
//完成所有的下载任务通知
49+
.AddListenerMultiAllDownloadCompleted(OnMultiAllDownloadCompleted)
50+
//下载过程出现的异常通知
51+
.AddListenerMultiDownloadError(OnMultiDownloadError)
52+
//整个更新过程出现的任何问题都会通过这个事件通知
53+
.AddListenerException(OnException)
54+
.SetConfig(configinfo)
55+
.Option(UpdateOption.DownloadTimeOut, 60)
56+
.Option(UpdateOption.Encoding, Encoding.Default)
57+
.Option(UpdateOption.Format, Format.ZIP)
58+
.Option(UpdateOption.Drive, false)
59+
.LaunchAsync();
60+
});*/
61+
62+
Console.Read();
63+
}
64+
65+
private static void OnMultiDownloadError(object arg1, MultiDownloadErrorEventArgs arg2)
66+
{
67+
}
68+
69+
private static void OnMultiAllDownloadCompleted(object arg1, MultiAllDownloadCompletedEventArgs arg2)
70+
{
71+
}
72+
73+
private static void OnMultiDownloadCompleted(object arg1, MultiDownloadCompletedEventArgs arg2)
74+
{
75+
}
76+
77+
private static void OnMultiDownloadStatistics(object arg1, MultiDownloadStatisticsEventArgs arg2)
78+
{
79+
}
80+
81+
private static void OnMultiDownloadProgressChanged(object arg1, MultiDownloadProgressChangedEventArgs arg2)
82+
{
83+
}
84+
85+
private static void OnException(object arg1, ExceptionEventArgs arg2)
86+
{
887
}
988
}
1089
}

0 commit comments

Comments
 (0)