From 6f1b407ae85e0f91367f42cc408826fa066c8d31 Mon Sep 17 00:00:00 2001 From: JusterZhu Date: Wed, 20 May 2026 19:24:44 +0800 Subject: [PATCH] fix: Program.cs namespace and Progress syntax errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Program.cs: GeneralUpdate.Tools.V12 → GeneralUpdate.Tools - PatchViewModel.cs: Progress<> → Progress (4 occurrences) --- src/Program.cs | 2 +- src/ViewModels/PatchViewModel.cs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Program.cs b/src/Program.cs index 4f1a67c..5b7935a 100644 --- a/src/Program.cs +++ b/src/Program.cs @@ -1,7 +1,7 @@ using Avalonia; using System; -namespace GeneralUpdate.Tools.V12; +namespace GeneralUpdate.Tools; sealed class Program { diff --git a/src/ViewModels/PatchViewModel.cs b/src/ViewModels/PatchViewModel.cs index 84102ca..9b06601 100644 --- a/src/ViewModels/PatchViewModel.cs +++ b/src/ViewModels/PatchViewModel.cs @@ -28,21 +28,21 @@ public partial class PatchViewModel : ViewModelBase [RelayCommand] async Task Build() { if (string.IsNullOrWhiteSpace(Config.OldDirectory) || string.IsNullOrWhiteSpace(Config.NewDirectory)) { Status = "请选择新旧版本目录"; return; } - IsBuilding = true; Log.Clear(); Progress<> = 0; Status = "正在生成差分补丁..."; + IsBuilding = true; Log.Clear(); Progress = 0; Status = "正在生成差分补丁..."; try { var tmp = Path.Combine(Path.GetTempPath(), $"gupatch_{DateTime.Now:yyyyMMddHHmmss}"); Directory.CreateDirectory(tmp); - L($"临时目录: {tmp}"); Progress<> = 20; + L($"临时目录: {tmp}"); Progress = 20; L("对比目录差异 + 生成 BSDiff40 补丁..."); await _diff.GeneratePatchAsync(Config.OldDirectory, Config.NewDirectory, tmp); - Progress<> = 70; L("补丁生成完成"); + Progress = 70; L("补丁生成完成"); var outDir = string.IsNullOrWhiteSpace(Config.OutputPath) ? Environment.GetFolderPath(Environment.SpecialFolder.Desktop) : Config.OutputPath; var name = string.IsNullOrWhiteSpace(Config.PackageName) ? $"patch_{DateTime.Now:yyyyMMddHHmmss}" : Config.PackageName; var zip = Path.Combine(outDir, $"{name}.zip"); L($"打包: {Path.GetFileName(zip)}"); await _pkg.CompressDirectoryAsync(tmp, zip); Directory.Delete(tmp, true); - Progress<> = 100; Config.OutputPath = zip; + Progress = 100; Config.OutputPath = zip; Status = $"成功: {Path.GetFileName(zip)} ({new FileInfo(zip).Length/1024.0:F1} KB)"; L(Status); }