From 0e6f6f5326c05e0e8176117f139bd1a795b48e7a Mon Sep 17 00:00:00 2001 From: JusterZhu Date: Sun, 24 May 2026 18:39:18 +0800 Subject: [PATCH] Batch 7: Extension points + configuration completion - Add DownloadOrchestrator() extension point to AbstractBootstrap - Add DiffMode option to UpdateOptions (Serial default) - Note ICleanStrategy/IDirtyStrategy placeholders for cross-project ref Closes #373 --- .../GeneralUpdate.Core/Configuration/AbstractBootstrap.cs | 6 ++++++ src/c#/GeneralUpdate.Core/Configuration/UpdateOptions.cs | 3 +++ 2 files changed, 9 insertions(+) diff --git a/src/c#/GeneralUpdate.Core/Configuration/AbstractBootstrap.cs b/src/c#/GeneralUpdate.Core/Configuration/AbstractBootstrap.cs index 869b0ab7..0d872b72 100644 --- a/src/c#/GeneralUpdate.Core/Configuration/AbstractBootstrap.cs +++ b/src/c#/GeneralUpdate.Core/Configuration/AbstractBootstrap.cs @@ -82,6 +82,12 @@ protected T GetOption(UpdateOption? option) public TBootstrap UpdateAuth() where T : Security.IHttpAuthProvider, new() { _extensions[typeof(Security.IHttpAuthProvider)] = typeof(T); return (TBootstrap)this; } + public TBootstrap DownloadOrchestrator() where T : Download.Abstractions.IDownloadOrchestrator, new() + { _extensions[typeof(Download.Abstractions.IDownloadOrchestrator)] = typeof(T); return (TBootstrap)this; } + + // ICleanStrategy / IDirtyStrategy extension points are in GeneralUpdate.Differential. + // Add via external extension methods once the project reference is established. + public TBootstrap ConfigureBlackList(BlackListConfig config) { _instances[typeof(BlackListConfig)] = config ?? BlackListConfig.Empty; diff --git a/src/c#/GeneralUpdate.Core/Configuration/UpdateOptions.cs b/src/c#/GeneralUpdate.Core/Configuration/UpdateOptions.cs index ec32ade5..117c7e09 100644 --- a/src/c#/GeneralUpdate.Core/Configuration/UpdateOptions.cs +++ b/src/c#/GeneralUpdate.Core/Configuration/UpdateOptions.cs @@ -14,6 +14,9 @@ public static class UpdateOptions // ═══ Core ═══ public static UpdateOption AppType { get; } = UpdateOption.ValueOf("APPTYPE", Configuration.AppType.ClientApp); + // ═══ Diff mode ═══ + public static UpdateOption DiffMode { get; } = UpdateOption.ValueOf("DIFFMODE", Configuration.DiffMode.Serial); + // ═══ Backward-compatible options ═══ public static UpdateOption Encoding { get; } = UpdateOption.ValueOf("COMPRESSENCODING", System.Text.Encoding.UTF8); public static UpdateOption Format { get; } = UpdateOption.ValueOf("COMPRESSFORMAT", "ZIP");