Skip to content

Commit b14c6b7

Browse files
committed
docs: add comprehensive XML documentation to all GeneralUpdate.Core sources
Add Chinese XML documentation comments following Microsoft official guidelines to all 57 source files across all modules: - Bootstrap: GeneralUpdateBootstrap, AbstractBootstrap - Strategy: IStrategy, AbstractStrategy, ClientUpdateStrategy, UpgradeUpdateStrategy, WindowsStrategy, LinuxStrategy, MacStrategy, OSSUpdateStrategy - Pipeline: IMiddleware, PipelineBuilder, PipelineContext, HashMiddleware, CompressMiddleware, PatchMiddleware, DiffPipeline, DiffPipelineBuilder, DiffPipelineOptions - Download: DefaultDownloadOrchestrator, HttpDownloadExecutor, DefaultDownloadPipeline, DefaultRetryPolicy, DownloadPlanBuilder, HttpDownloadSource, IDownloadSource, DownloadProgressReporter, IUpdateReporter, IDownloadOrchestrator, IDownloadExecutor - Configuration: Configinfo, GlobalConfigInfo, BaseConfigInfo, ConfiginfoBuilder, ConfigurationMapper, UpdateOptions, ProcessInfo, VersionInfo, UpdateOption, UpdateOptionValue - FileSystem: StorageManager, DefaultBlackListMatcher, IBlackListMatcher, FileTreeEnumerator, FileTree, FileNode, ComparisonResult, FileTreeComparer, FileTreeDiffer, FileTreeSnapshot - Event: EventManager, IUpdateEventListener, ExceptionEventArgs, ProgressEventArgs - Network: VersionService - Silent: SilentPollOrchestrator - Differential: ICleanMatcher, IDirtyMatcher, DefaultCleanMatcher, DefaultDirtyMatcher Each documented with <summary>, <remarks> (flow/logic), <param>, <returns>, <exception>, <see cref> tags. Core methods include numbered step-by-step flow descriptions.
1 parent 8ce2d0d commit b14c6b7

57 files changed

Lines changed: 5597 additions & 706 deletions

Some content is hidden

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

src/c#/GeneralUpdate.Core/Bootstrap/GeneralUpdateBootstrap.cs

Lines changed: 58 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,53 @@
2727
namespace GeneralUpdate.Core;
2828

2929
/// <summary>
30-
/// Unified update bootstrap — single entry point for Client, Upgrade, and OSS roles.
31-
/// Use <see cref="AppType"/> to select the workflow:
32-
/// <list type="bullet">
33-
/// <item><see cref="AppType.Client"/> — validate versions, download, start upgrade process</item>
34-
/// <item><see cref="AppType.Upgrade"/> — receive ProcessInfo, apply updates, start main app</item>
35-
/// <item><see cref="AppType.OSSClient"/> — OSS client: download version config, start upgrade process</item>
36-
/// <item><see cref="AppType.OSSUpgrade"/> — OSS upgrade: download packages from cloud, start main app</item>
37-
/// </list>
30+
/// Unified update entry point for all application update scenarios.
31+
/// Configure the update via fluent methods, then call <see cref="LaunchAsync"/> to execute.
3832
/// </summary>
3933
/// <remarks>
40-
/// For Client mode, use <c>Option(UpdateOptions.AppType, AppType.Client)</c>.
34+
/// <para><b>Core flow:</b></para>
35+
/// <para>
36+
/// 1. <b>Configuration</b> — <see cref="SetConfig(Configinfo)"/> loads parameters (versions, paths, URLs).<br/>
37+
/// 2. <b>Extension resolution</b> — <see cref="LaunchWithStrategy"/> resolves all registered
38+
/// extension points (strategy, hooks, download components, network policies) and injects
39+
/// them into the role strategy.<br/>
40+
/// 3. <b>Role dispatch</b> — <see cref="AppType"/> selects the role strategy:<br/>
41+
/// • <see cref="AppType.Client"/> — validates against server, downloads packages,
42+
/// applies upgrade packages in-place, serializes client packages to IPC, and launches
43+
/// the upgrade process.<br/>
44+
/// • <see cref="AppType.Upgrade"/> — reads IPC data, applies client packages via the
45+
/// OS pipeline, then starts the main application.<br/>
46+
/// • <see cref="AppType.OSSClient"/>/<see cref="AppType.OSSUpgrade"/> — OSS-based
47+
/// workflow for cloud storage (AliYun, AWS S3, MinIO).<br/>
48+
/// 4. <b>Platform resolution</b> — <see cref="Strategy.ClientUpdateStrategy.ResolveOsStrategy"/>
49+
/// detects the OS and creates <c>WindowsStrategy</c>, <c>LinuxStrategy</c>, or
50+
/// <c>MacStrategy</c> unless overridden via <c>Strategy&lt;T&gt;()</c>.<br/>
51+
/// 5. <b>Pipeline execution</b> — the OS strategy runs <c>HashMiddleware → CompressMiddleware
52+
/// → PatchMiddleware</c> for each update version.<br/>
53+
/// 6. <b>App launch</b> — the OS strategy starts the updated main application.
54+
/// </para>
55+
/// <para><b>Silent mode:</b> when <c>Option(UpdateOptions.Silent, true)</c> is set on
56+
/// <see cref="AppType.Client"/>, launches a background poll loop via
57+
/// <see cref="Silent.SilentPollOrchestrator"/> and returns immediately. Updates are
58+
/// prepared on process exit.</para>
59+
/// <para><b>Extension points:</b> <see cref="AbstractBootstrap{TBootstrap, TStrategy}"/>
60+
/// provides fluent methods for injecting custom implementations of hooks, download
61+
/// components, network policies, and OS strategy.</para>
4162
/// </remarks>
63+
/// <example>
64+
/// <code>
65+
/// var result = await new GeneralUpdateBootstrap()
66+
/// .SetConfig(new Configinfo {
67+
/// UpdateUrl = "https://api.example.com",
68+
/// ClientVersion = "1.0.0",
69+
/// InstallPath = @"C:\MyApp",
70+
/// AppSecretKey = "my-key"
71+
/// })
72+
/// .Option(UpdateOptions.AppType, AppType.Client)
73+
/// .Hooks&lt;MyCustomHooks&gt;()
74+
/// .LaunchAsync();
75+
/// </code>
76+
/// </example>
4277
public class GeneralUpdateBootstrap : AbstractBootstrap<GeneralUpdateBootstrap, IStrategy>
4378
{
4479
private GlobalConfigInfo _configInfo = new();
@@ -58,10 +93,12 @@ public void Cancel()
5893
GeneralTracer.Info("GeneralUpdateBootstrap: cancellation requested.");
5994
}
6095

61-
// ════════════════════════════════════════════════════════════════
62-
// Launch — AppType dispatch via role strategies
63-
// ════════════════════════════════════════════════════════════════
64-
96+
/// <summary>
97+
/// Dispatches the update workflow based on <see cref="AppType"/>.
98+
/// <see cref="AppType.Client"/> with silent mode returns immediately after starting a
99+
/// background poll; all other modes run synchronously.
100+
/// </summary>
101+
/// <returns>This bootstrap instance for chaining.</returns>
65102
public override async Task<GeneralUpdateBootstrap> LaunchAsync()
66103
{
67104
var appType = GetOption(UpdateOptions.AppType);
@@ -177,10 +214,14 @@ private async Task<GeneralUpdateBootstrap> LaunchWithStrategy(IStrategy roleStra
177214
return this;
178215
}
179216

180-
// ════════════════════════════════════════════════════════════════
181-
// Configuration
182-
// ════════════════════════════════════════════════════════════════
183-
217+
/// <summary>
218+
/// Applies the primary configuration object. Validates required fields, maps to
219+
/// the internal <see cref="GlobalConfigInfo"/>, and initialises the blacklist
220+
/// matcher for file exclusion during update operations.
221+
/// </summary>
222+
/// <param name="configInfo">User-facing configuration. Must have non-null
223+
/// <c>UpdateUrl</c>, <c>AppSecretKey</c>, <c>ClientVersion</c>, <c>InstallPath</c>.</param>
224+
/// <returns>This bootstrap instance for chaining.</returns>
184225
public GeneralUpdateBootstrap SetConfig(Configinfo configInfo)
185226
{
186227
configInfo.Validate();

0 commit comments

Comments
 (0)