-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy pathGeneralUpdateBootstrap.cs
More file actions
566 lines (481 loc) · 24.7 KB
/
Copy pathGeneralUpdateBootstrap.cs
File metadata and controls
566 lines (481 loc) · 24.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
using GeneralUpdate.Core.FileSystem;
using GeneralUpdate.Core.Download;
using GeneralUpdate.Core.Event;
using GeneralUpdate.Core.Configuration;
using GeneralUpdate.Core.JsonContext;
using GeneralUpdate.Core.Strategy;
using GeneralUpdate.Core.Network;
namespace GeneralUpdate.Core;
/// <summary>
/// Unified update bootstrap — single entry point for both Client and Upgrade roles.
/// Use <see cref="AppType"/> to select the workflow:
/// <list type="bullet">
/// <item><see cref="AppType.ClientApp"/> — validate versions, download, start upgrade process</item>
/// <item><see cref="AppType.UpgradeApp"/> — receive ProcessInfo, apply updates, start main app</item>
/// </list>
/// </summary>
/// <remarks>
/// <b>Migration from GeneralClientBootstrap:</b>
/// Replace <c>new GeneralClientBootstrap().SetConfig(cfg).LaunchAsync()</c> with
/// <c>new GeneralUpdateBootstrap().Option(UpdateOptions.AppType, AppType.ClientApp).SetConfig(cfg).LaunchAsync()</c>.
/// </remarks>
public class GeneralUpdateBootstrap : AbstractBootstrap<GeneralUpdateBootstrap, IStrategy>
{
private GlobalConfigInfo _configInfo = new();
private IStrategy? _strategy;
private Func<bool>? _customSkipOption;
private Func<UpdateInfoEventArgs, bool>? _updatePrecheck;
private readonly List<Func<bool>> _customOptions = new();
public GeneralUpdateBootstrap()
{
InitializeFromEnvironment();
}
// ════════════════════════════════════════════════════════════════
// Launch — AppType dispatch
// ════════════════════════════════════════════════════════════════
public override async Task<GeneralUpdateBootstrap> LaunchAsync()
{
int appType = GetOption(UpdateOptions.AppType);
return appType switch
{
AppType.ClientApp => await LaunchClientAsync(),
AppType.UpgradeApp => await LaunchUpgradeAsync(),
_ => await LaunchClientAsync() // default to Client for backward compatibility
};
}
/// <summary>Client workflow: validate versions, download, start upgrade process.</summary>
private async Task<GeneralUpdateBootstrap> LaunchClientAsync()
{
try
{
GeneralTracer.Debug("GeneralUpdateBootstrap.LaunchClientAsync start.");
CallSmallBowlHome(_configInfo.Bowl);
ExecuteCustomOptions();
await ExecuteClientWorkflowAsync();
}
catch (Exception ex)
{
GeneralTracer.Error("LaunchClientAsync threw an exception.", ex);
EventManager.Instance.Dispatch(this, new ExceptionEventArgs(ex, ex.Message));
}
return this;
}
/// <summary>Upgrade workflow: receive ProcessInfo, apply updates, start main app.</summary>
private async Task<GeneralUpdateBootstrap> LaunchUpgradeAsync()
{
GeneralTracer.Debug("GeneralUpdateBootstrap.LaunchUpgradeAsync start.");
StrategyFactory();
switch (GetOption(UpdateOption.Mode) ?? UpdateMode.Default)
{
case UpdateMode.Default:
ApplyRuntimeOptions();
_strategy!.Create(_configInfo);
await DownloadAsync();
await _strategy.ExecuteAsync();
break;
case UpdateMode.Scripts:
await ExecuteUpgradeWorkflowAsync();
break;
default:
throw new ArgumentOutOfRangeException();
}
return this;
}
// ════════════════════════════════════════════════════════════════
// Configuration
// ════════════════════════════════════════════════════════════════
public GeneralUpdateBootstrap SetConfig(Configinfo configInfo)
{
_configInfo = ConfigurationMapper.MapToGlobalConfigInfo(configInfo);
var appType = GetOption(UpdateOptions.AppType);
if (appType != AppType.UpgradeApp)
{
_configInfo.TempPath = StorageManager.GetTempDirectory("upgrade_temp");
_configInfo.DriveEnabled = GetOption(UpdateOption.Drive) ?? false;
_configInfo.PatchEnabled = GetOption(UpdateOption.Patch) ?? true;
InitBlackList();
}
return this;
}
public GeneralUpdateBootstrap SetCustomSkipOption(Func<bool>? func)
{
_customSkipOption = func;
return this;
}
/// <summary>
/// Registers a callback invoked when update information is available.
/// Returns <c>true</c> to skip the update; <c>false</c> to proceed.
/// Forced-update protection still applies — the callback return value is
/// ignored if any version is marked as forcibly required.
/// </summary>
public GeneralUpdateBootstrap AddListenerUpdatePrecheck(Func<UpdateInfoEventArgs, bool> func)
{
_updatePrecheck = func ?? throw new ArgumentNullException(nameof(func));
return this;
}
/// <summary>
/// Add custom operations to execute before the update workflow.
/// Recommended for environment checks to ensure dependencies are available after update.
/// </summary>
public GeneralUpdateBootstrap AddCustomOption(List<Func<bool>> funcList)
{
Debug.Assert(funcList != null && funcList.Any());
_customOptions.AddRange(funcList);
return this;
}
// ════════════════════════════════════════════════════════════════
// Client Workflow
// ════════════════════════════════════════════════════════════════
private async Task ExecuteClientWorkflowAsync()
{
try
{
Debug.Assert(_configInfo != null);
// Silent mode
if (GetOption(UpdateOption.EnableSilentUpdate))
{
GeneralTracer.Info("GeneralUpdateBootstrap.ExecuteClientWorkflowAsync: silent mode, delegating to SilentUpdateMode.");
await new SilentUpdateMode(
_configInfo,
GetOption(UpdateOption.Encoding) ?? Encoding.Default,
GetOption(UpdateOption.Format) ?? Format.ZIP,
GetOption(UpdateOption.DownloadTimeOut) ?? 60,
GetOption(UpdateOption.Patch) ?? true,
GetOption(UpdateOption.BackUp) ?? true).StartAsync();
return;
}
// Dual version validation
GeneralTracer.Info($"GeneralUpdateBootstrap.ExecuteClientWorkflowAsync: validating client={_configInfo.ClientVersion}, upgrade={_configInfo.UpgradeClientVersion}");
var mainResp = await VersionService.Validate(_configInfo.UpdateUrl
, _configInfo.ClientVersion, AppType.ClientApp, _configInfo.AppSecretKey
, GetPlatform(), _configInfo.ProductId, _configInfo.Scheme, _configInfo.Token);
var upgradeResp = await VersionService.Validate(_configInfo.UpdateUrl
, _configInfo.UpgradeClientVersion, AppType.UpgradeApp, _configInfo.AppSecretKey
, GetPlatform(), _configInfo.ProductId, _configInfo.Scheme, _configInfo.Token);
_configInfo.IsUpgradeUpdate = CheckUpgrade(upgradeResp);
_configInfo.IsMainUpdate = CheckUpgrade(mainResp);
GeneralTracer.Info($"ExecuteClientWorkflowAsync: IsMainUpdate={_configInfo.IsMainUpdate}, IsUpgradeUpdate={_configInfo.IsUpgradeUpdate}");
var updateInfoArgs = new UpdateInfoEventArgs(mainResp);
EventManager.Instance.Dispatch(this, updateInfoArgs);
var isForcibly = CheckForcibly(mainResp.Body) || CheckForcibly(upgradeResp.Body);
if (CanSkipClient(isForcibly, updateInfoArgs))
{
GeneralTracer.Info("ExecuteClientWorkflowAsync: update skipped by precheck callback.");
return;
}
InitBlackList();
ApplyRuntimeOptions();
_configInfo.TempPath = StorageManager.GetTempDirectory("main_temp");
_configInfo.BackupDirectory = Path.Combine(_configInfo.InstallPath,
$"{StorageManager.DirectoryName}{_configInfo.ClientVersion}");
_configInfo.UpdateVersions = _configInfo.IsUpgradeUpdate
? upgradeResp.Body.OrderBy(x => x.ReleaseDate).ToList()
: new List<VersionInfo>();
if (_configInfo.IsMainUpdate)
{
_configInfo.LastVersion = mainResp.Body.OrderBy(x => x.ReleaseDate).Last().Version;
GeneralTracer.Info($"ExecuteClientWorkflowAsync: main update, LastVersion={_configInfo.LastVersion}");
var failed = CheckFail(_configInfo.LastVersion);
if (failed)
{
GeneralTracer.Warn($"ExecuteClientWorkflowAsync: version {_configInfo.LastVersion} matches known-failed upgrade, aborting.");
return;
}
var processInfo = ConfigurationMapper.MapToProcessInfo(
_configInfo, mainResp.Body,
BlackListManager.Instance.BlackFormats.ToList(),
BlackListManager.Instance.BlackFiles.ToList(),
BlackListManager.Instance.SkipDirectorys.ToList());
_configInfo.ProcessInfo = JsonSerializer.Serialize(
processInfo, ProcessInfoJsonContext.Default.ProcessInfo);
}
if (GetOption(UpdateOption.BackUp) ?? true)
{
GeneralTracer.Info($"ExecuteClientWorkflowAsync: backing up {_configInfo.InstallPath} -> {_configInfo.BackupDirectory}");
StorageManager.Backup(_configInfo.InstallPath, _configInfo.BackupDirectory,
BlackListManager.Instance.SkipDirectorys);
}
StrategyFactory();
GeneralTracer.Info($"ExecuteClientWorkflowAsync: IsUpgradeUpdate={_configInfo.IsUpgradeUpdate}, IsMainUpdate={_configInfo.IsMainUpdate}");
switch (_configInfo.IsUpgradeUpdate)
{
case true when _configInfo.IsMainUpdate:
GeneralTracer.Info("ExecuteClientWorkflowAsync: both upgrade+main — downloading and executing.");
await DownloadAsync();
await _strategy!.ExecuteAsync();
_strategy.StartApp();
break;
case true when !_configInfo.IsMainUpdate:
GeneralTracer.Info("ExecuteClientWorkflowAsync: upgrade-only — downloading and executing.");
await DownloadAsync();
await _strategy!.ExecuteAsync();
break;
case false when _configInfo.IsMainUpdate:
GeneralTracer.Info("ExecuteClientWorkflowAsync: main-only — starting updater.");
_strategy!.StartApp();
break;
}
}
catch (Exception ex)
{
GeneralTracer.Error("ExecuteClientWorkflowAsync threw an exception.", ex);
EventManager.Instance.Dispatch(this, new ExceptionEventArgs(ex, ex.Message));
}
}
// ════════════════════════════════════════════════════════════════
// Upgrade Workflow
// ════════════════════════════════════════════════════════════════
private async Task ExecuteUpgradeWorkflowAsync()
{
try
{
GeneralTracer.Info($"GeneralUpdateBootstrap.ExecuteUpgradeWorkflowAsync: validating version. UpdateUrl={_configInfo.UpdateUrl}, ClientVersion={_configInfo.ClientVersion}");
var mainResp = await VersionService.Validate(
_configInfo.UpdateUrl, _configInfo.ClientVersion,
AppType.ClientApp, _configInfo.AppSecretKey,
GetPlatform(), _configInfo.ProductId,
_configInfo.Scheme, _configInfo.Token);
_configInfo.IsMainUpdate = CheckUpgrade(mainResp);
GeneralTracer.Info($"ExecuteUpgradeWorkflowAsync: IsMainUpdate={_configInfo.IsMainUpdate}");
EventManager.Instance.Dispatch(this, new UpdateInfoEventArgs(mainResp));
if (CanSkip(CheckForcibly(mainResp.Body)))
{
GeneralTracer.Info("ExecuteUpgradeWorkflowAsync: update skipped.");
return;
}
InitBlackList();
ApplyRuntimeOptions();
_configInfo.TempPath = StorageManager.GetTempDirectory("main_temp");
_configInfo.BackupDirectory = Path.Combine(
_configInfo.InstallPath,
$"{StorageManager.DirectoryName}{_configInfo.ClientVersion}");
_configInfo.UpdateVersions = mainResp.Body!
.OrderBy(x => x.ReleaseDate).ToList();
GeneralTracer.Info($"ExecuteUpgradeWorkflowAsync: {_configInfo.UpdateVersions.Count} version(s) queued.");
if (GetOption(UpdateOption.BackUp) ?? true)
{
GeneralTracer.Info($"ExecuteUpgradeWorkflowAsync: backing up {_configInfo.InstallPath} -> {_configInfo.BackupDirectory}");
StorageManager.Backup(
_configInfo.InstallPath, _configInfo.BackupDirectory,
BlackListManager.Instance.SkipDirectorys);
}
_strategy!.Create(_configInfo);
if (_configInfo.IsMainUpdate)
{
GeneralTracer.Info("ExecuteUpgradeWorkflowAsync: main update required, starting download and execution.");
await DownloadAsync();
await _strategy.ExecuteAsync();
}
else
{
GeneralTracer.Info("ExecuteUpgradeWorkflowAsync: no update needed, starting application.");
_strategy.StartApp();
}
}
catch (Exception ex)
{
GeneralTracer.Error("ExecuteUpgradeWorkflowAsync threw an exception.", ex);
EventManager.Instance.Dispatch(this, new ExceptionEventArgs(ex, ex.Message));
}
}
// ════════════════════════════════════════════════════════════════
// Download
// ════════════════════════════════════════════════════════════════
private async Task DownloadAsync()
{
var manager = new DownloadManager(
_configInfo.TempPath, _configInfo.Format, _configInfo.DownloadTimeOut);
manager.MultiAllDownloadCompleted += OnMultiAllDownloadCompleted;
manager.MultiDownloadCompleted += OnMultiDownloadCompleted;
manager.MultiDownloadError += OnMultiDownloadError;
manager.MultiDownloadStatistics += OnMultiDownloadStatistics;
foreach (var version in _configInfo.UpdateVersions)
manager.Add(new DownloadTask(manager, version));
await manager.LaunchTasksAsync();
}
// ════════════════════════════════════════════════════════════════
// Helpers
// ════════════════════════════════════════════════════════════════
private void InitializeFromEnvironment()
{
var json = Environments.GetEnvironmentVariable("ProcessInfo");
if (string.IsNullOrWhiteSpace(json)) return;
var processInfo = JsonSerializer.Deserialize(
json, ProcessInfoJsonContext.Default.ProcessInfo);
if (processInfo == null) return;
BlackListManager.Instance.AddBlackFormats(processInfo.BlackFileFormats);
BlackListManager.Instance.AddBlackFiles(processInfo.BlackFiles);
BlackListManager.Instance.AddSkipDirectorys(processInfo.SkipDirectorys);
_configInfo = new GlobalConfigInfo
{
MainAppName = processInfo.AppName,
InstallPath = processInfo.InstallPath,
ClientVersion = processInfo.CurrentVersion,
LastVersion = processInfo.LastVersion,
UpdateLogUrl = processInfo.UpdateLogUrl,
Encoding = Encoding.GetEncoding(processInfo.CompressEncoding),
Format = processInfo.CompressFormat,
DownloadTimeOut = processInfo.DownloadTimeOut,
AppSecretKey = processInfo.AppSecretKey,
UpdateVersions = processInfo.UpdateVersions,
TempPath = StorageManager.GetTempDirectory("upgrade_temp"),
ReportUrl = processInfo.ReportUrl,
BackupDirectory = processInfo.BackupDirectory,
Scheme = processInfo.Scheme,
Token = processInfo.Token,
DriveEnabled = GetOption(UpdateOption.Drive) ?? false,
PatchEnabled = GetOption(UpdateOption.Patch) ?? true,
Script = processInfo.Script,
DriverDirectory = processInfo.DriverDirectory
};
}
private void ApplyRuntimeOptions()
{
_configInfo.Encoding = GetOption(UpdateOption.Encoding) ?? Encoding.Default;
_configInfo.Format = GetOption(UpdateOption.Format) ?? Format.ZIP;
_configInfo.DownloadTimeOut = GetOption(UpdateOption.DownloadTimeOut) ?? 60;
_configInfo.DriveEnabled = GetOption(UpdateOption.Drive) ?? false;
_configInfo.PatchEnabled = GetOption(UpdateOption.Patch) ?? true;
}
private void InitBlackList()
{
BlackListManager.Instance.AddBlackFiles(_configInfo.BlackFiles);
BlackListManager.Instance.AddBlackFormats(_configInfo.BlackFormats);
BlackListManager.Instance.AddSkipDirectorys(_configInfo.SkipDirectorys);
}
private bool CanSkip(bool isForcibly)
{
if (isForcibly) return false;
return _customSkipOption?.Invoke() == true;
}
private bool CanSkipClient(bool isForcibly, UpdateInfoEventArgs updateInfo)
{
if (isForcibly) return false;
return _updatePrecheck?.Invoke(updateInfo) == true;
}
private static bool CheckUpgrade(VersionRespDTO? response)
=> response?.Code == 200 && response.Body?.Count > 0;
private static bool CheckForcibly(IEnumerable<VersionInfo>? versions)
=> versions?.Any(v => v.IsForcibly == true) == true;
private static int GetPlatform()
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) return PlatformType.Windows;
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) return PlatformType.Linux;
return -1;
}
/// <summary>Check if the target version matches a known-failed upgrade.</summary>
private bool CheckFail(string version)
{
var fail = Environments.GetEnvironmentVariable("UpgradeFail");
if (string.IsNullOrEmpty(fail) || string.IsNullOrEmpty(version))
return false;
var failVersion = new Version(fail);
var lastVersion = new Version(version);
return failVersion >= lastVersion;
}
/// <summary>Kill existing Bowl watchdog processes before update.</summary>
private void CallSmallBowlHome(string processName)
{
if (string.IsNullOrWhiteSpace(processName)) return;
try
{
var processes = Process.GetProcessesByName(processName);
if (processes.Length == 0)
{
GeneralTracer.Info($"No process named {processName} found.");
return;
}
foreach (var process in processes)
{
GeneralTracer.Info($"Killing process {process.ProcessName} (ID: {process.Id})");
process.Kill();
}
}
catch (Exception ex)
{
GeneralTracer.Error("CallSmallBowlHome threw an exception.", ex);
EventManager.Instance.Dispatch(this, new ExceptionEventArgs(ex, ex.Message));
}
}
/// <summary>Execute all registered custom pre-update operations.</summary>
private void ExecuteCustomOptions()
{
if (!_customOptions.Any()) return;
foreach (var option in _customOptions)
{
if (!option.Invoke())
{
var exception = new Exception($"{nameof(option)} execution failure!");
GeneralTracer.Error("ExecuteCustomOptions failed.", exception);
EventManager.Instance.Dispatch(this,
new ExceptionEventArgs(exception, exception.Message));
}
}
}
// ════════════════════════════════════════════════════════════════
// Strategy & Events
// ════════════════════════════════════════════════════════════════
protected override GeneralUpdateBootstrap StrategyFactory()
{
_strategy = RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
? new WindowsStrategy()
: RuntimeInformation.IsOSPlatform(OSPlatform.Linux)
? new LinuxStrategy()
: throw new PlatformNotSupportedException("The current operating system is not supported!");
return this;
}
protected override Task ExecuteStrategyAsync() => throw new NotImplementedException();
protected override void ExecuteStrategy() => throw new NotImplementedException();
private GeneralUpdateBootstrap AddListener<TArgs>(Action<object, TArgs> action) where TArgs : EventArgs
{
if (action is null) throw new ArgumentNullException(nameof(action));
EventManager.Instance.AddListener(action);
return this;
}
public GeneralUpdateBootstrap AddListenerMultiAllDownloadCompleted(
Action<object, MultiAllDownloadCompletedEventArgs> cb) => AddListener(cb);
public GeneralUpdateBootstrap AddListenerMultiDownloadCompleted(
Action<object, MultiDownloadCompletedEventArgs> cb) => AddListener(cb);
public GeneralUpdateBootstrap AddListenerMultiDownloadError(
Action<object, MultiDownloadErrorEventArgs> cb) => AddListener(cb);
public GeneralUpdateBootstrap AddListenerMultiDownloadStatistics(
Action<object, MultiDownloadStatisticsEventArgs> cb) => AddListener(cb);
public GeneralUpdateBootstrap AddListenerException(
Action<object, ExceptionEventArgs> cb) => AddListener(cb);
public GeneralUpdateBootstrap AddListenerUpdateInfo(
Action<object, UpdateInfoEventArgs> cb) => AddListener(cb);
private void OnMultiDownloadStatistics(object sender, MultiDownloadStatisticsEventArgs e)
{
GeneralTracer.Info(
$"Multi download statistics, {ObjectTranslator.GetPacketHash(e.Version)} " +
$"[BytesReceived]:{e.BytesReceived} [ProgressPercentage]:{e.ProgressPercentage} " +
$"[Remaining]:{e.Remaining} [TotalBytesToReceive]:{e.TotalBytesToReceive} [Speed]:{e.Speed}");
EventManager.Instance.Dispatch(sender, e);
}
private void OnMultiDownloadCompleted(object sender, MultiDownloadCompletedEventArgs e)
{
GeneralTracer.Info(
$"Multi download completed, {ObjectTranslator.GetPacketHash(e.Version)} [IsCompleted]:{e.IsComplated}");
EventManager.Instance.Dispatch(sender, e);
}
private void OnMultiDownloadError(object sender, MultiDownloadErrorEventArgs e)
{
GeneralTracer.Error(
$"Multi download error {ObjectTranslator.GetPacketHash(e.Version)}.", e.Exception);
EventManager.Instance.Dispatch(sender, e);
}
private void OnMultiAllDownloadCompleted(object sender, MultiAllDownloadCompletedEventArgs e)
{
GeneralTracer.Info($"Multi all download completed {e.IsAllDownloadCompleted}.");
EventManager.Instance.Dispatch(sender, e);
}
}