Free, open-source Windows optimization tool for performance, privacy, and simplicity.
C# csharpdebloatdotnetgamingopen-sourceoptimizationoptimizeroptimizerduckperformanceprivacytweakertweakswindowswinui
refactor: format files
fatDuckd453ceb00bc9
diff --git a/optimizerDuck.Test/Domain/Features/BaseFeatureTests.cs b/optimizerDuck.Test/Domain/Features/BaseFeatureTests.csindex 9a093ff..c36c086 100644--- a/optimizerDuck.Test/Domain/Features/BaseFeatureTests.cs+++ b/optimizerDuck.Test/Domain/Features/BaseFeatureTests.cs@@ -20,16 +20,16 @@ public class BaseFeatureTests : IDisposable// The test will use the actual class nameprotected override IEnumerable<RegistryToggle> RegistryToggles =>- [- new()- {- Path = TestKeyPath,- Name = "TestValue",- OnValue = 1,- OffValue = 0,- ValueKind = RegistryValueKind.DWord,- },- ];+ [+ new()+ {+ Path = TestKeyPath,+ Name = "TestValue",+ OnValue = 1,+ OffValue = 0,+ ValueKind = RegistryValueKind.DWord,+ },+ ];}public BaseFeatureTests()@@ -111,8 +111,10 @@ public class BaseFeatureTests : IDisposablestopwatch.Stop();// Should complete quickly (not blocking on UI thread equivalent)- Assert.True(stopwatch.ElapsedMilliseconds < 1000,- $"Operations took {stopwatch.ElapsedMilliseconds}ms, expected < 1000ms");+ Assert.True(+ stopwatch.ElapsedMilliseconds < 1000,+ $"Operations took {stopwatch.ElapsedMilliseconds}ms, expected < 1000ms"+ );}[Fact]@@ -124,11 +126,15 @@ public class BaseFeatureTests : IDisposablefor (int i = 0; i < 10; i++){await feature.EnableAsync();- var enabledValue = RegistryService.Read<int>(new RegistryItem(TestKeyPath, "TestValue"));+ var enabledValue = RegistryService.Read<int>(+ new RegistryItem(TestKeyPath, "TestValue")+ );Assert.Equal(1, enabledValue);await feature.DisableAsync();- var disabledValue = RegistryService.Read<int>(new RegistryItem(TestKeyPath, "TestValue"));+ var disabledValue = RegistryService.Read<int>(+ new RegistryItem(TestKeyPath, "TestValue")+ );Assert.Equal(0, disabledValue);}diff --git a/optimizerDuck.Test/Services/ApplyRevertComprehensiveTests.cs b/optimizerDuck.Test/Services/ApplyRevertComprehensiveTests.csindex 3e20c31..94e8cea 100644--- a/optimizerDuck.Test/Services/ApplyRevertComprehensiveTests.cs+++ b/optimizerDuck.Test/Services/ApplyRevertComprehensiveTests.cs@@ -34,19 +34,31 @@ public class ApplyRevertComprehensiveTests"Shell","Step 1: Disable service",true,- new ShellRevertStep { ShellType = ShellType.CMD, Command = "sc config TestService start= auto" }+ new ShellRevertStep+ {+ ShellType = ShellType.CMD,+ Command = "sc config TestService start= auto",+ });ExecutionScope.RecordStep("Shell","Step 2: Registry change",true,- new ShellRevertStep { ShellType = ShellType.PowerShell, Command = "Set-ItemProperty -Path 'HKLM:\\Test' -Name 'Value' -Value 0" }+ new ShellRevertStep+ {+ ShellType = ShellType.PowerShell,+ Command = "Set-ItemProperty -Path 'HKLM:\\Test' -Name 'Value' -Value 0",+ });ExecutionScope.RecordStep("Shell","Step 3: File operation",true,- new ShellRevertStep { ShellType = ShellType.CMD, Command = "del C:\\test.txt" }+ new ShellRevertStep+ {+ ShellType = ShellType.CMD,+ Command = "del C:\\test.txt",+ });return Task.FromResult(ApplyResult.True());},@@ -72,7 +84,7 @@ public class ApplyRevertComprehensiveTestsAssert.NotNull(data);Assert.Equal(optimization.Id, data!.OptimizationId);Assert.Equal(3, data.Steps.Length);-+// Verify all steps are present and in correct orderAssert.NotNull(data.Steps[0]);Assert.NotNull(data.Steps[1]);@@ -80,7 +92,7 @@ public class ApplyRevertComprehensiveTestsAssert.Equal("Shell", data.Steps[0]!.Type);Assert.Equal("Shell", data.Steps[1]!.Type);Assert.Equal("Shell", data.Steps[2]!.Type);-+// Verify revert commands are correctAssert.Equal("sc config TestService start= auto",@@ -103,8 +115,6 @@ public class ApplyRevertComprehensiveTests});}--#endregion#region Apply Partial Success Scenarios@@ -160,7 +170,7 @@ public class ApplyRevertComprehensiveTestsvar data = await RevertManager.GetRevertDataAsync(optimization.Id);Assert.NotNull(data);Assert.Equal(3, data!.Steps.Length);-+// Step 1 should be null (failed), steps 2 and 3 should existAssert.Null(data.Steps[0]);Assert.NotNull(data.Steps[1]);@@ -189,26 +199,14 @@ public class ApplyRevertComprehensiveTeststrue,new ShellRevertStep { ShellType = ShellType.CMD, Command = "exit 11" });- ExecutionScope.RecordStep(- "Shell",- "Step 2: Fail",- false,- null,- "fail 2"- );+ ExecutionScope.RecordStep("Shell", "Step 2: Fail", false, null, "fail 2");ExecutionScope.RecordStep("Shell","Step 3: Success",true,new ShellRevertStep { ShellType = ShellType.CMD, Command = "exit 33" });- ExecutionScope.RecordStep(- "Shell",- "Step 4: Fail",- false,- null,- "fail 4"- );+ ExecutionScope.RecordStep("Shell", "Step 4: Fail", false, null, "fail 4");ExecutionScope.RecordStep("Shell","Step 5: Success",@@ -238,14 +236,14 @@ public class ApplyRevertComprehensiveTestsvar data = await RevertManager.GetRevertDataAsync(optimization.Id);Assert.NotNull(data);Assert.Equal(5, data!.Steps.Length);-+// Verify pattern: success, fail, success, fail, successAssert.NotNull(data.Steps[0]);Assert.Null(data.Steps[1]);Assert.NotNull(data.Steps[2]);Assert.Null(data.Steps[3]);Assert.NotNull(data.Steps[4]);-+// Verify commands are at correct indicesAssert.Equal("exit 11",@@ -277,20 +275,8 @@ public class ApplyRevertComprehensiveTests{ApplyImpl = _ =>{- ExecutionScope.RecordStep(- "Shell",- "Step 1: Fail",- false,- null,- "fail 1"- );- ExecutionScope.RecordStep(- "Shell",- "Step 2: Fail",- false,- null,- "fail 2"- );+ ExecutionScope.RecordStep("Shell", "Step 1: Fail", false, null, "fail 1");+ ExecutionScope.RecordStep("Shell", "Step 2: Fail", false, null, "fail 2");return Task.FromResult(ApplyResult.False("All steps failed"));},};@@ -604,7 +590,7 @@ public class ApplyRevertComprehensiveTestsAssert.False(result.AllStepsFailed);Assert.Single(result.FailedSteps);Assert.False(File.Exists(revertPath)); // File deleted because not all steps failed-+// Failed step should have retry actionAssert.NotNull(result.FailedSteps[0].RetryAction);}@@ -741,7 +727,9 @@ public class ApplyRevertComprehensiveTests// Retry will fail because the command is still "exit 1"// This is expected behavior - retry just re-executes the same command// ExecuteAsync throws exception on failure, so we need to catch it- var exception = await Record.ExceptionAsync(async () => await failedStep.RetryAction!());+ var exception = await Record.ExceptionAsync(async () =>+ await failedStep.RetryAction!()+ );Assert.NotNull(exception); // Expected to throwAssert.False(File.Exists(revertPath));}@@ -826,13 +814,7 @@ public class ApplyRevertComprehensiveTeststrue,new ShellRevertStep { ShellType = ShellType.CMD, Command = "exit 0" });- ExecutionScope.RecordStep(- "Shell",- "Step 2",- false,- null,- "Step 2 failed"- );+ ExecutionScope.RecordStep("Shell", "Step 2", false, null, "Step 2 failed");ExecutionScope.RecordStep("Shell","Step 3",@@ -960,7 +942,7 @@ public class ApplyRevertComprehensiveTestsvar data = await RevertManager.GetRevertDataAsync(optimization.Id);Assert.NotNull(data);Assert.Equal(3, data!.Steps.Length);-+// All steps should now have "exit 0" commandsAssert.Equal("exit 0",diff --git a/optimizerDuck.Test/Services/Managers/RevertManagerTests.cs b/optimizerDuck.Test/Services/Managers/RevertManagerTests.csindex 7cffad4..e5d84b2 100644--- a/optimizerDuck.Test/Services/Managers/RevertManagerTests.cs+++ b/optimizerDuck.Test/Services/Managers/RevertManagerTests.cs@@ -38,7 +38,7 @@ public class RevertManagerTestsOptimizationId = id,OptimizationName = "TestOptimization",AppliedAt = DateTime.UtcNow,- Steps = Array.Empty<RevertStepData?>()+ Steps = Array.Empty<RevertStepData?>(),};trydiff --git a/optimizerDuck.Test/Services/OptimizationServiceIntegrationTests.cs b/optimizerDuck.Test/Services/OptimizationServiceIntegrationTests.csindex 8a2ea2e..745eef2 100644--- a/optimizerDuck.Test/Services/OptimizationServiceIntegrationTests.cs+++ b/optimizerDuck.Test/Services/OptimizationServiceIntegrationTests.cs@@ -46,24 +46,13 @@ public class OptimizationServiceIntegrationTests : IDisposable_stepCount = 0;// Step 1: Always succeeds- ExecutionScope.RecordStep(- "Test",- "Step 1",- true,- new TestRevertStep { StepId = 1 }- );+ ExecutionScope.RecordStep("Test", "Step 1", true, new TestRevertStep { StepId = 1 });_stepCount++;// Step 2: May failif (_shouldFail){- ExecutionScope.RecordStep(- "Test",- "Step 2",- false,- null,- "Simulated failure"- );+ ExecutionScope.RecordStep("Test", "Step 2", false, null, "Simulated failure");_stepCount++;}@@ -81,9 +70,7 @@ public class OptimizationServiceIntegrationTests : IDisposablevar success = !_shouldFail;return Task.FromResult(- success- ? ApplyResult.True()- : ApplyResult.False("Step 2 failed intentionally")+ success ? ApplyResult.True() : ApplyResult.False("Step 2 failed intentionally"));}}@@ -108,9 +95,7 @@ public class OptimizationServiceIntegrationTests : IDisposableprivate readonly List<Guid> _testOptimizationIds = new();- public OptimizationServiceIntegrationTests()- {- }+ public OptimizationServiceIntegrationTests() { }public void Dispose(){diff --git a/optimizerDuck.Test/Services/OptimizationServiceTests.cs b/optimizerDuck.Test/Services/OptimizationServiceTests.csindex cb7486b..3b073a4 100644--- a/optimizerDuck.Test/Services/OptimizationServiceTests.cs+++ b/optimizerDuck.Test/Services/OptimizationServiceTests.cs@@ -260,7 +260,7 @@ public class OptimizationServiceTestsAssert.NotNull(data);Assert.Equal(3, data!.Steps.Length);Assert.Equal("Shell", data.Steps[0]!.Type);- Assert.Null(data.Steps[1]); // Gap - step 2 failed+ Assert.Null(data.Steps[1]); // Gap - step 2 failedAssert.Equal("Shell", data.Steps[2]!.Type);Assert.Equal("exit 11",diff --git a/optimizerDuck.Test/Services/OptimizationServices/RegistryServiceTests.cs b/optimizerDuck.Test/Services/OptimizationServices/RegistryServiceTests.csindex 4419006..95c2048 100644--- a/optimizerDuck.Test/Services/OptimizationServices/RegistryServiceTests.cs+++ b/optimizerDuck.Test/Services/OptimizationServices/RegistryServiceTests.cs@@ -238,8 +238,8 @@ public class RegistryServiceTests : IDisposable// In real scenario, this would be caught by transaction logic// Get all revert steps- var revertSteps = newScope.ExecutedSteps- .Where(s => s.RevertStep != null)+ var revertSteps = newScope+ .ExecutedSteps.Where(s => s.RevertStep != null).Select(s => s.RevertStep!).ToList();@@ -267,12 +267,14 @@ public class RegistryServiceTests : IDisposablevar key = $@"{BaseTestKey}\ConcurrentTest{i}";var value = $"Value{i}";- tasks.Add(Task.Run(() =>- {- Assert.True(RegistryService.Write(new RegistryItem(key, "Value", value)));- var read = RegistryService.Read<string>(new RegistryItem(key, "Value"));- Assert.Equal(value, read);- }));+ tasks.Add(+ Task.Run(() =>+ {+ Assert.True(RegistryService.Write(new RegistryItem(key, "Value", value)));+ var read = RegistryService.Read<string>(new RegistryItem(key, "Value"));+ Assert.Equal(value, read);+ })+ );}await Task.WhenAll(tasks);@@ -293,17 +295,39 @@ public class RegistryServiceTests : IDisposablevar key = $@"{BaseTestKey}\TypeConversionTest";// Test different value types- Assert.True(RegistryService.Write(new RegistryItem(key, "DWordValue", 42, RegistryValueKind.DWord)));+ Assert.True(+ RegistryService.Write(new RegistryItem(key, "DWordValue", 42, RegistryValueKind.DWord))+ );Assert.Equal(42, RegistryService.Read<int>(new RegistryItem(key, "DWordValue")));- Assert.True(RegistryService.Write(new RegistryItem(key, "QWordValue", 9999999999L, RegistryValueKind.QWord)));+ Assert.True(+ RegistryService.Write(+ new RegistryItem(key, "QWordValue", 9999999999L, RegistryValueKind.QWord)+ )+ );Assert.Equal(9999999999L, RegistryService.Read<long>(new RegistryItem(key, "QWordValue")));- Assert.True(RegistryService.Write(new RegistryItem(key, "StringValue", "TestString", RegistryValueKind.String)));- Assert.Equal("TestString", RegistryService.Read<string>(new RegistryItem(key, "StringValue")));+ Assert.True(+ RegistryService.Write(+ new RegistryItem(key, "StringValue", "TestString", RegistryValueKind.String)+ )+ );+ Assert.Equal(+ "TestString",+ RegistryService.Read<string>(new RegistryItem(key, "StringValue"))+ );var multiString = new[] { "Line1", "Line2", "Line3" };- Assert.True(RegistryService.Write(new RegistryItem(key, "MultiStringValue", multiString, RegistryValueKind.MultiString)));+ Assert.True(+ RegistryService.Write(+ new RegistryItem(+ key,+ "MultiStringValue",+ multiString,+ RegistryValueKind.MultiString+ )+ )+ );var readMulti = RegistryService.Read<string[]>(new RegistryItem(key, "MultiStringValue"));Assert.Equal(multiString, readMulti);}@@ -327,8 +351,8 @@ public class RegistryServiceTests : IDisposableAssert.True(RegistryService.Write(new RegistryItem(key2, "Value", "Modified2")));// Revert in reverse order (LIFO)- var revertSteps = newScope.ExecutedSteps- .Where(s => s.RevertStep != null)+ var revertSteps = newScope+ .ExecutedSteps.Where(s => s.RevertStep != null).Select(s => s.RevertStep!).ToList();@@ -366,6 +390,9 @@ public class RegistryServiceTests : IDisposable// Non-empty key should remainAssert.True(RegistryService.KeyExists(new RegistryItem(nonEmptyKeyPath)));- Assert.Equal("SomeValue", RegistryService.Read<string>(new RegistryItem(nonEmptyKeyPath, "Value")));+ Assert.Equal(+ "SomeValue",+ RegistryService.Read<string>(new RegistryItem(nonEmptyKeyPath, "Value"))+ );}}diff --git a/optimizerDuck/App.xaml.cs b/optimizerDuck/App.xaml.csindex e9862fb..1f9f26d 100644--- a/optimizerDuck/App.xaml.cs+++ b/optimizerDuck/App.xaml.cs@@ -54,7 +54,7 @@ public class ScopeBlockTextFormatter : ITextFormatter};//var prefix = $"{timestamp} | {ctx,-67} | {levelText,-7} | "; // byebye 67 char SourceContext truncation, we have a new design now...- var prefix = $"{timestamp} | {ctx,-35} | {levelText,-7} | ";+ var prefix = $"{timestamp} | {ctx, -35} | {levelText, -7} | ";// print messageoutput.WriteLine(prefix + RenderWithoutQuotes(logEvent));diff --git a/optimizerDuck/Common/Helpers/EmbeddedResourceHelper.cs b/optimizerDuck/Common/Helpers/EmbeddedResourceHelper.csindex 24ecd35..a8fbe15 100644--- a/optimizerDuck/Common/Helpers/EmbeddedResourceHelper.cs+++ b/optimizerDuck/Common/Helpers/EmbeddedResourceHelper.cs@@ -64,7 +64,8 @@ public static class EmbeddedResourceHelperFileAccess.Write,FileShare.None,bufferSize: 8192,- useAsync: false);+ useAsync: false+ );stream.CopyTo(fileStream);return true;diff --git a/optimizerDuck/Domain/Features/Categories/Desktop.cs b/optimizerDuck/Domain/Features/Categories/Desktop.csindex ef342fb..2a7931f 100644--- a/optimizerDuck/Domain/Features/Categories/Desktop.cs+++ b/optimizerDuck/Domain/Features/Categories/Desktop.cs@@ -146,17 +146,19 @@ public class Desktop : IFeatureCategoryprivate const string Path =@"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Icons";-private readonly string[] HiddenShortcutValues =- [- @"%windir%\System32\shell32.dll,-50",- @"%windir%\System32\shell32.dll,50",- ];+ [+ @"%windir%\System32\shell32.dll,-50",+ @"%windir%\System32\shell32.dll,50",+ ];private bool IsHiddenShortcutOverlay(string value){- if (HiddenShortcutValues.Any(v =>- string.Equals(value, v, StringComparison.OrdinalIgnoreCase)))+ if (+ HiddenShortcutValues.Any(v =>+ string.Equals(value, v, StringComparison.OrdinalIgnoreCase)+ )+ ){return true;}@@ -166,15 +168,9 @@ public class Desktop : IFeatureCategoryif (string.IsNullOrWhiteSpace(fileName))return false;- return fileName.Equals(- "blank.ico",- StringComparison.OrdinalIgnoreCase)- || fileName.Equals(- "transparent.ico",- StringComparison.OrdinalIgnoreCase)- || fileName.Equals(- "blankicon.ico",- StringComparison.OrdinalIgnoreCase);+ return fileName.Equals("blank.ico", StringComparison.OrdinalIgnoreCase)+ || fileName.Equals("transparent.ico", StringComparison.OrdinalIgnoreCase)+ || fileName.Equals("blankicon.ico", StringComparison.OrdinalIgnoreCase);}public override Task<bool> GetStateAsync()@@ -202,13 +198,15 @@ public class Desktop : IFeatureCategorypublic override async Task DisableAsync(){// extract the blank icon to the app resources folder, then set the registry value to point to it- var outputPath = System.IO.Path.Combine(Shared.AssetsDirectory, nameof(Desktop), "blank.ico");+ var outputPath = System.IO.Path.Combine(+ Shared.AssetsDirectory,+ nameof(Desktop),+ "blank.ico"+ );EmbeddedResourceHelper.TryExtract("Icons.blank.ico", outputPath);// set the registry value to point to the blank icon, which effectively hides the shortcut arrow overlay- RegistryService.Write(- new RegistryItem(Path, "29", outputPath)- );+ RegistryService.Write(new RegistryItem(Path, "29", outputPath));await ExecutePostActionAsync();}diff --git a/optimizerDuck/Domain/Optimizations/Categories/Performance.cs b/optimizerDuck/Domain/Optimizations/Categories/Performance.csindex b219610..a7e7f45 100644--- a/optimizerDuck/Domain/Optimizations/Categories/Performance.cs+++ b/optimizerDuck/Domain/Optimizations/Categories/Performance.cs@@ -175,26 +175,10 @@ public class Performance : IOptimizationCategory// Games task scheduling (Priority, Scheduling Category, SFIO Priority, GPU Priority)RegistryService.Write(- new RegistryItem(- $@"{systemProfileKey}\Tasks\Games",- "Priority",- 2- ),- new RegistryItem(- $@"{systemProfileKey}\Tasks\Games",- "Scheduling Category",- "High"- ),- new RegistryItem(- $@"{systemProfileKey}\Tasks\Games",- "SFIO Priority",- "High"- ),- new RegistryItem(- $@"{systemProfileKey}\Tasks\Games",- "GPU Priority",- 8- )+ new RegistryItem($@"{systemProfileKey}\Tasks\Games", "Priority", 2),+ new RegistryItem($@"{systemProfileKey}\Tasks\Games", "Scheduling Category", "High"),+ new RegistryItem($@"{systemProfileKey}\Tasks\Games", "SFIO Priority", "High"),+ new RegistryItem($@"{systemProfileKey}\Tasks\Games", "GPU Priority", 8));context.Logger.LogInformation(diff --git a/optimizerDuck/Domain/Optimizations/Categories/PowerManagement.cs b/optimizerDuck/Domain/Optimizations/Categories/PowerManagement.csindex a085073..4ee1d0c 100644--- a/optimizerDuck/Domain/Optimizations/Categories/PowerManagement.cs+++ b/optimizerDuck/Domain/Optimizations/Categories/PowerManagement.cs@@ -32,14 +32,17 @@ public class PowerManagement : IOptimizationCategoryOptimizationContext context){- var wasEnabled = RegistryService.Read<int>(new RegistryItem(@"SYSTEM\CurrentControlSet\Control\Session Manager\Power", "HibernateEnabled")) != 0;- string revertCommand = wasEnabled- ? "powercfg /h on"- : "powercfg /h off";+ var wasEnabled =+ RegistryService.Read<int>(+ new RegistryItem(+ @"SYSTEM\CurrentControlSet\Control\Session Manager\Power",+ "HibernateEnabled"+ )+ ) != 0;+ string revertCommand = wasEnabled ? "powercfg /h on" : "powercfg /h off";await ShellService.CMDAsync("powercfg /h off", revertCommand);-context.Logger.LogInformation("Disabled hibernation and Fast Startup. Previous state: {State}",wasEnabled ? "Enabled" : "Disabled"@@ -121,9 +124,7 @@ public class PowerManagement : IOptimizationCategoryOptimizationContext context){- var activeQuery = await ShellService.CMDAsync(- "powercfg /getactivescheme"- );+ var activeQuery = await ShellService.CMDAsync("powercfg /getactivescheme");var match = Regex.Match(activeQuery.Stdout,@"Power Scheme GUID:\s*([a-fA-F0-9\-]{36})",@@ -229,5 +230,4 @@ public class PowerManagement : IOptimizationCategoryreturn Task.FromResult(ApplyResult.True());}}-}diff --git a/optimizerDuck/Domain/Optimizations/Categories/SecurityAndPrivacy.cs b/optimizerDuck/Domain/Optimizations/Categories/SecurityAndPrivacy.csindex a945dc7..6b1bd42 100644--- a/optimizerDuck/Domain/Optimizations/Categories/SecurityAndPrivacy.cs+++ b/optimizerDuck/Domain/Optimizations/Categories/SecurityAndPrivacy.cs@@ -19,8 +19,6 @@ public class SecurityAndPrivacy : IOptimizationCategoryOptimizationCategoryOrder.SecurityAndPrivacy;public ObservableCollection<IOptimization> Optimizations { get; init; } = [];--[Optimization(Id = "74DC8DAC-1F90-4BBD-ACF7-7E626749D71C",Risk = OptimizationRisk.Moderate,diff --git a/optimizerDuck/Services/Optimization/Providers/ShellService.cs b/optimizerDuck/Services/Optimization/Providers/ShellService.csindex c0d1f33..d650577 100644--- a/optimizerDuck/Services/Optimization/Providers/ShellService.cs+++ b/optimizerDuck/Services/Optimization/Providers/ShellService.cs@@ -567,8 +567,17 @@ public static class ShellServiceCancellationToken ct = default){- return RunAsync("cmd.exe", "/c", command, nameof(CMD), new ShellRevertStep { ShellType = ShellType.CMD, Command = revertCommand }, policy, ct);+ return RunAsync(+ "cmd.exe",+ "/c",+ command,+ nameof(CMD),+ new ShellRevertStep { ShellType = ShellType.CMD, Command = revertCommand },+ policy,+ ct+ );}+public static Task<ShellResult> CMDAsync(string command,ShellRevertStep? revertStep = null,@@ -586,7 +595,15 @@ public static class ShellServiceCancellationToken ct = default){- return RunAsync("cmd.exe", "/c", command, nameof(CMD), new ShellRevertStep { ShellType = ShellType.CMD, Command = revertCommand() }, policy, ct);+ return RunAsync(+ "cmd.exe",+ "/c",+ command,+ nameof(CMD),+ new ShellRevertStep { ShellType = ShellType.CMD, Command = revertCommand() },+ policy,+ ct+ );}/// <summary>diff --git a/optimizerDuck/UI/ViewModels/Optimizer/OptimizationCategoryViewModel.cs b/optimizerDuck/UI/ViewModels/Optimizer/OptimizationCategoryViewModel.csindex 2eacf5b..724e886 100644--- a/optimizerDuck/UI/ViewModels/Optimizer/OptimizationCategoryViewModel.cs+++ b/optimizerDuck/UI/ViewModels/Optimizer/OptimizationCategoryViewModel.cs@@ -204,7 +204,7 @@ public partial class OptimizationCategoryViewModel : ViewModel// Explicitly update state after all operations completeawait OptimizationService.UpdateOptimizationStateAsync(optimization);-+// Ensure UI reflects the correct stateOnPropertyChanged(nameof(HasAppliedOptimizations));@@ -260,10 +260,10 @@ public partial class OptimizationCategoryViewModel : ViewModelrevertResult.FailedSteps,OptimizationOperation.Revert);-+// Explicitly update state after revert completesawait OptimizationService.UpdateOptimizationStateAsync(optimization);-+// Ensure UI reflects the correct stateOnPropertyChanged(nameof(HasAppliedOptimizations));