Skip to content

Free, open-source Windows optimization tool for performance, privacy, and simplicity.

chore: format with csharpier

fatDuck388753139a78
diff --git a/optimizerDuck/App.xaml.cs b/optimizerDuck/App.xaml.cs
index 500062d..6bb9a9a 100644
--- a/optimizerDuck/App.xaml.cs
+++ b/optimizerDuck/App.xaml.cs
@@ -302,7 +302,8 @@ public partial class App : Application
)
.CreateLogger();
- _host = Microsoft.Extensions.Hosting.Host.CreateDefaultBuilder()
+ _host = Microsoft
+ .Extensions.Hosting.Host.CreateDefaultBuilder()
.UseSerilog()
.ConfigureAppConfiguration(c =>
{
diff --git a/optimizerDuck/Domain/Customize/Categories/SystemFeatures.cs b/optimizerDuck/Domain/Customize/Categories/SystemFeatures.cs
index aadf85e..5572a93 100644
--- a/optimizerDuck/Domain/Customize/Categories/SystemFeatures.cs
+++ b/optimizerDuck/Domain/Customize/Categories/SystemFeatures.cs
@@ -32,6 +32,7 @@ public class SystemFeatures : LocalizedObject, ICustomizeCategory
public SymbolRegular Icon { get; init; } = SymbolRegular.WindowSettings20;
public CustomizeOrder Order { get; init; } = CustomizeOrder.System;
public ObservableCollection<ICustomizeSetting> Features { get; init; } = [];
+
[CustomizeSetting(
Section = nameof(Sections.Input),
Icon = SymbolRegular.NumberSymbol24,
@@ -43,7 +44,8 @@ public class SystemFeatures : LocalizedObject, ICustomizeCategory
private const string PathCurrent = @"HKCU\Control Panel\Keyboard";
private const string ValueName = "InitialKeyboardIndicators";
- protected override IReadOnlyList<string> GetWatchedRegistryPaths() => [PathDefault, PathCurrent];
+ protected override IReadOnlyList<string> GetWatchedRegistryPaths() =>
+ [PathDefault, PathCurrent];
public override Task<bool> GetStateAsync()
{
@@ -54,7 +56,14 @@ public class SystemFeatures : LocalizedObject, ICustomizeCategory
var raw = RegistryService.Read<object?>(new RegistryItem(path, ValueName));
if (raw == null)
return false;
- if (long.TryParse(raw.ToString(), NumberStyles.Integer, CultureInfo.InvariantCulture, out var v))
+ if (
+ long.TryParse(
+ raw.ToString(),
+ NumberStyles.Integer,
+ CultureInfo.InvariantCulture,
+ out var v
+ )
+ )
return (v & 2) == 2;
return false;
}
@@ -67,13 +76,29 @@ public class SystemFeatures : LocalizedObject, ICustomizeCategory
{
var isOn = value is bool b && b;
- var currentRaw = RegistryService.Read<object?>(new RegistryItem(PathCurrent, ValueName));
- var defaultRaw = RegistryService.Read<object?>(new RegistryItem(PathDefault, ValueName));
+ var currentRaw = RegistryService.Read<object?>(
+ new RegistryItem(PathCurrent, ValueName)
+ );
+ var defaultRaw = RegistryService.Read<object?>(
+ new RegistryItem(PathDefault, ValueName)
+ );
RegistryService.Write(
- new RegistryItem(PathCurrent, ValueName, SetNumLockBit(currentRaw, isOn), RegistryValueKind.String));
+ new RegistryItem(
+ PathCurrent,
+ ValueName,
+ SetNumLockBit(currentRaw, isOn),
+ RegistryValueKind.String
+ )
+ );
RegistryService.Write(
- new RegistryItem(PathDefault, ValueName, SetNumLockBit(defaultRaw, isOn), RegistryValueKind.String));
+ new RegistryItem(
+ PathDefault,
+ ValueName,
+ SetNumLockBit(defaultRaw, isOn),
+ RegistryValueKind.String
+ )
+ );
if (NeedsPostAction)
await ExecutePostActionAsync();
@@ -81,7 +106,14 @@ public class SystemFeatures : LocalizedObject, ICustomizeCategory
private static string SetNumLockBit(object? raw, bool enabled)
{
- if (!long.TryParse(raw?.ToString(), NumberStyles.Integer, CultureInfo.InvariantCulture, out var value))
+ if (
+ !long.TryParse(
+ raw?.ToString(),
+ NumberStyles.Integer,
+ CultureInfo.InvariantCulture,
+ out var value
+ )
+ )
{
value = 0;
}
diff --git a/optimizerDuck/Domain/Execution/ExecutionScope.cs b/optimizerDuck/Domain/Execution/ExecutionScope.cs
index 9c01f64..321b79a 100644
--- a/optimizerDuck/Domain/Execution/ExecutionScope.cs
+++ b/optimizerDuck/Domain/Execution/ExecutionScope.cs
@@ -342,10 +342,20 @@ public sealed class ExecutionScope : IDisposable
Status = status,
Message = status switch
{
- OptimizationSuccessResult.Success => Loc.Instance["Optimization.Apply.Success", OptimizationName],
- OptimizationSuccessResult.Failed when allFailed => Loc.Instance["Optimization.Apply.Error.Failed", OptimizationName],
+ OptimizationSuccessResult.Success => Loc.Instance[
+ "Optimization.Apply.Success",
+ OptimizationName
+ ],
+ OptimizationSuccessResult.Failed when allFailed => Loc.Instance[
+ "Optimization.Apply.Error.Failed",
+ OptimizationName
+ ],
OptimizationSuccessResult.PartialSuccess or OptimizationSuccessResult.Failed =>
- Loc.Instance["Optimization.Apply.Error.FailedWithSteps", OptimizationName, failedSteps.Count],
+ Loc.Instance[
+ "Optimization.Apply.Error.FailedWithSteps",
+ OptimizationName,
+ failedSteps.Count
+ ],
_ => Loc.Instance["Optimization.Apply.Error.Unknown", OptimizationName],
},
FailedSteps = failedSteps,
diff --git a/optimizerDuck/Domain/Optimizations/Categories/BloatwareAndServices.cs b/optimizerDuck/Domain/Optimizations/Categories/BloatwareAndServices.cs
index a64ddd2..7e4dc6f 100644
--- a/optimizerDuck/Domain/Optimizations/Categories/BloatwareAndServices.cs
+++ b/optimizerDuck/Domain/Optimizations/Categories/BloatwareAndServices.cs
@@ -320,7 +320,11 @@ public class BloatwareAndServices : LocalizedObject, IOptimizationCategory
progress?.Report(
new ProcessingProgress
{
- Message = Loc.Instance[$"{ProgressPrefix}.ChangeServiceStartupType", service.Name, service.StartupType],
+ Message = Loc.Instance[
+ $"{ProgressPrefix}.ChangeServiceStartupType",
+ service.Name,
+ service.StartupType
+ ],
Value = i + 1,
Total = servicesToChange.Count,
}
diff --git a/optimizerDuck/Domain/Revert/Steps/RegistryRevertStep.cs b/optimizerDuck/Domain/Revert/Steps/RegistryRevertStep.cs
index 194ed21..aab86cb 100644
--- a/optimizerDuck/Domain/Revert/Steps/RegistryRevertStep.cs
+++ b/optimizerDuck/Domain/Revert/Steps/RegistryRevertStep.cs
@@ -57,11 +57,22 @@ public class RegistryRevertStep : IRevertStep
public string Description =>
Action switch
{
- RevertAction.RestorePrevious => Loc.Instance["Revert.Registry.Description.Restore", Path, Name ?? "(Default)"],
- RevertAction.NoPreviousValue => Loc.Instance["Revert.Registry.Description.Delete", Path, Name ?? "(Default)"],
+ RevertAction.RestorePrevious => Loc.Instance[
+ "Revert.Registry.Description.Restore",
+ Path,
+ Name ?? "(Default)"
+ ],
+ RevertAction.NoPreviousValue => Loc.Instance[
+ "Revert.Registry.Description.Delete",
+ Path,
+ Name ?? "(Default)"
+ ],
RevertAction.RestoreKey => Loc.Instance["Revert.Registry.Description.RestoreKey", Path],
RevertAction.DeleteKey => Loc.Instance["Revert.Registry.Description.DeleteKey", Path],
- RevertAction.RestoreKeyTree => Loc.Instance["Revert.Registry.Description.RestoreKey", Path],
+ RevertAction.RestoreKeyTree => Loc.Instance[
+ "Revert.Registry.Description.RestoreKey",
+ Path
+ ],
_ => Loc.Instance["Revert.Registry.Description.RevertUnknown", Path],
};
diff --git a/optimizerDuck/Domain/Revert/Steps/ScheduledTaskRevertStep.cs b/optimizerDuck/Domain/Revert/Steps/ScheduledTaskRevertStep.cs
index dab7e65..59d75a4 100644
--- a/optimizerDuck/Domain/Revert/Steps/ScheduledTaskRevertStep.cs
+++ b/optimizerDuck/Domain/Revert/Steps/ScheduledTaskRevertStep.cs
@@ -27,7 +27,9 @@ public class ScheduledTaskRevertStep : IRevertStep
/// <inheritdoc />
public string Description =>
- OriginalEnabled ? Loc.Instance["Revert.ScheduledTask.Description.Enable", FullPath] : Loc.Instance["Revert.ScheduledTask.Description.Disable", FullPath];
+ OriginalEnabled
+ ? Loc.Instance["Revert.ScheduledTask.Description.Enable", FullPath]
+ : Loc.Instance["Revert.ScheduledTask.Description.Disable", FullPath];
/// <inheritdoc />
public Task<bool> ExecuteAsync()
diff --git a/optimizerDuck/Domain/Revert/Steps/ShellRevertStep.cs b/optimizerDuck/Domain/Revert/Steps/ShellRevertStep.cs
index bce0b48..c53737c 100644
--- a/optimizerDuck/Domain/Revert/Steps/ShellRevertStep.cs
+++ b/optimizerDuck/Domain/Revert/Steps/ShellRevertStep.cs
@@ -27,8 +27,7 @@ public class ShellRevertStep : IRevertStep
public string Type => "Shell";
/// <inheritdoc />
- public string Description =>
- Loc.Instance["Revert.Shell.Description.Run", ShellType, Command];
+ public string Description => Loc.Instance["Revert.Shell.Description.Run", ShellType, Command];
/// <inheritdoc />
public async Task<bool> ExecuteAsync()
diff --git a/optimizerDuck/Services/Optimization/OptimizationService.cs b/optimizerDuck/Services/Optimization/OptimizationService.cs
index 14968f1..6fa347d 100644
--- a/optimizerDuck/Services/Optimization/OptimizationService.cs
+++ b/optimizerDuck/Services/Optimization/OptimizationService.cs
@@ -399,7 +399,12 @@ public class OptimizationService(
progress?.Report(
new ProcessingProgress
{
- Message = Loc.Instance["Optimization.RetryStep.Processing", step.Name, processedCount, total],
+ Message = Loc.Instance[
+ "Optimization.RetryStep.Processing",
+ step.Name,
+ processedCount,
+ total
+ ],
Value = processedCount,
Total = total,
}
diff --git a/optimizerDuck/Services/Optimization/Providers/RegistryService.cs b/optimizerDuck/Services/Optimization/Providers/RegistryService.cs
index c18ec8d..68f6116 100644
--- a/optimizerDuck/Services/Optimization/Providers/RegistryService.cs
+++ b/optimizerDuck/Services/Optimization/Providers/RegistryService.cs
@@ -265,7 +265,11 @@ public static class RegistryService
item,
key =>
{
- var description = Loc.Invariant["Service.Registry.Description.Write", item.Path, item.Name];
+ var description = Loc.Invariant[
+ "Service.Registry.Description.Write",
+ item.Path,
+ item.Name
+ ];
try
{
var valueName = NormalizeValueName(item.Name);
@@ -315,7 +319,11 @@ public static class RegistryService
catch (UnauthorizedAccessException)
{
_lastError.Value = Loc.Invariant["Service.Common.Error.AccessDenied"];
- _lastErrorDetail.Value = Loc.Invariant["Service.Registry.ErrorDetail.AccessDeniedWrite", item.Path, item.Name];
+ _lastErrorDetail.Value = Loc.Invariant[
+ "Service.Registry.ErrorDetail.AccessDeniedWrite",
+ item.Path,
+ item.Name
+ ];
ExecutionScope.LogError(
null,
"Access denied writing {Path}:{Name}",
@@ -374,7 +382,11 @@ public static class RegistryService
item,
key =>
{
- var description = Loc.Invariant["Service.Registry.Description.Delete", item.Path, item.Name ?? "(Default)"];
+ var description = Loc.Invariant[
+ "Service.Registry.Description.Delete",
+ item.Path,
+ item.Name ?? "(Default)"
+ ];
try
{
var valueName = NormalizeValueName(item.Name);
@@ -428,7 +440,11 @@ public static class RegistryService
catch (UnauthorizedAccessException)
{
_lastError.Value = Loc.Invariant["Service.Common.Error.AccessDenied"];
- _lastErrorDetail.Value = Loc.Invariant["Service.Registry.ErrorDetail.AccessDeniedDelete", item.Path, item.Name];
+ _lastErrorDetail.Value = Loc.Invariant[
+ "Service.Registry.ErrorDetail.AccessDeniedDelete",
+ item.Path,
+ item.Name
+ ];
ExecutionScope.LogError(
null,
"Access denied deleting {Path}:{Name}",
@@ -525,7 +541,10 @@ public static class RegistryService
catch (UnauthorizedAccessException)
{
_lastError.Value = Loc.Invariant["Service.Common.Error.AccessDenied"];
- _lastErrorDetail.Value = Loc.Invariant["Service.Registry.ErrorDetail.AccessDeniedCreateKey", item.Path];
+ _lastErrorDetail.Value = Loc.Invariant[
+ "Service.Registry.ErrorDetail.AccessDeniedCreateKey",
+ item.Path
+ ];
ExecutionScope.LogError(null, "Access denied creating {Path}", item.Path);
ExecutionScope.Track(nameof(CreateSubKey), false);
ExecutionScope.RecordStep(
@@ -629,7 +648,10 @@ public static class RegistryService
catch (UnauthorizedAccessException)
{
_lastError.Value = Loc.Invariant["Service.Registry.Error.AccessDeniedProtectedHive"];
- _lastErrorDetail.Value = Loc.Invariant["Service.Registry.ErrorDetail.AccessDeniedDeleteKeyTree", item.Path];
+ _lastErrorDetail.Value = Loc.Invariant[
+ "Service.Registry.ErrorDetail.AccessDeniedDeleteKeyTree",
+ item.Path
+ ];
ExecutionScope.LogError(null, "Access denied deleting {Path}", item.Path);
ExecutionScope.Track(nameof(DeleteSubKeyTree), false);
ExecutionScope.RecordStep(
diff --git a/optimizerDuck/Services/Optimization/Providers/ScheduledTaskService.cs b/optimizerDuck/Services/Optimization/Providers/ScheduledTaskService.cs
index 9778f95..1e92410 100644
--- a/optimizerDuck/Services/Optimization/Providers/ScheduledTaskService.cs
+++ b/optimizerDuck/Services/Optimization/Providers/ScheduledTaskService.cs
@@ -80,7 +80,10 @@ public static class ScheduledTaskService
catch (UnauthorizedAccessException)
{
_lastError.Value = Loc.Invariant["Service.Common.Error.AccessDenied"];
- _lastErrorDetail.Value = Loc.Invariant["Service.ScheduledTask.ErrorDetail.AccessDeniedDisable", fullPath];
+ _lastErrorDetail.Value = Loc.Invariant[
+ "Service.ScheduledTask.ErrorDetail.AccessDeniedDisable",
+ fullPath
+ ];
ExecutionScope.LogError(null, "Access denied disabling task {Path}", fullPath);
ExecutionScope.Track(nameof(DisableTask), false);
ExecutionScope.RecordStep(
@@ -155,7 +158,10 @@ public static class ScheduledTaskService
catch (UnauthorizedAccessException)
{
_lastError.Value = Loc.Invariant["Service.Common.Error.AccessDenied"];
- _lastErrorDetail.Value = Loc.Invariant["Service.ScheduledTask.ErrorDetail.AccessDeniedEnable", fullPath];
+ _lastErrorDetail.Value = Loc.Invariant[
+ "Service.ScheduledTask.ErrorDetail.AccessDeniedEnable",
+ fullPath
+ ];
ExecutionScope.LogError(null, "Access denied enabling task {Path}", fullPath);
ExecutionScope.Track(nameof(EnableTask), false);
ExecutionScope.RecordStep(
diff --git a/optimizerDuck/Services/Optimization/Providers/ServiceProcessService.cs b/optimizerDuck/Services/Optimization/Providers/ServiceProcessService.cs
index d28b9da..2fc6b0c 100644
--- a/optimizerDuck/Services/Optimization/Providers/ServiceProcessService.cs
+++ b/optimizerDuck/Services/Optimization/Providers/ServiceProcessService.cs
@@ -133,7 +133,11 @@ public static class ServiceProcessService
{
_lastError.Value = _lastErrorDetail.Value = null;
- var description = Loc.Invariant["Service.Service.Description.Change", item.Name, item.StartupType];
+ var description = Loc.Invariant[
+ "Service.Service.Description.Change",
+ item.Name,
+ item.StartupType
+ ];
var sw = Stopwatch.StartNew();
try
@@ -143,7 +147,10 @@ public static class ServiceProcessService
if (notFound)
{
sw.Stop();
- var skipDescription = Loc.Invariant["Service.Service.Info.SkippedNotFound", item.Name];
+ var skipDescription = Loc.Invariant[
+ "Service.Service.Info.SkippedNotFound",
+ item.Name
+ ];
ExecutionScope.LogInfo("[SERVICE][{Name}] not found, skipping", item.Name);
ExecutionScope.Track(nameof(ChangeServiceStartupTypeAsync), true);
ExecutionScope.RecordStep(
@@ -242,7 +249,11 @@ public static class ServiceProcessService
}
catch (Exception ex)
{
- _lastError.Value = Loc.Invariant["Service.Service.Error.ExceptionOccurred", item.Name, ex.Message];
+ _lastError.Value = Loc.Invariant[
+ "Service.Service.Error.ExceptionOccurred",
+ item.Name,
+ ex.Message
+ ];
_lastErrorDetail.Value = ex.ToString();
ExecutionScope.LogError(
diff --git a/optimizerDuck/Services/Revert/RevertManager.cs b/optimizerDuck/Services/Revert/RevertManager.cs
index 3521e0c..52eedc7 100644
--- a/optimizerDuck/Services/Revert/RevertManager.cs
+++ b/optimizerDuck/Services/Revert/RevertManager.cs
@@ -96,7 +96,12 @@ public class RevertManager(ILogger<RevertManager> _logger, ILoggerFactory _logge
progress?.Report(
new ProcessingProgress
{
- Message = Loc.Instance["Optimization.Revert.ExecutingStep", remaining, total, step.Type],
+ Message = Loc.Instance[
+ "Optimization.Revert.ExecutingStep",
+ remaining,
+ total,
+ step.Type
+ ],
Value = remaining,
Total = total,
}
@@ -161,7 +166,11 @@ public class RevertManager(ILogger<RevertManager> _logger, ILoggerFactory _logge
failedSteps.Count == total
? Loc.Instance["Optimization.Revert.Error.Failed", optimization.Name]
: failedSteps.Count > 0
- ? Loc.Instance["Optimization.Revert.Error.FailedWithSteps", optimization.Name, failedSteps.Count]
+ ? Loc.Instance[
+ "Optimization.Revert.Error.FailedWithSteps",
+ optimization.Name,
+ failedSteps.Count
+ ]
: Loc.Instance["Optimization.Revert.Success", optimization.Name],
FailedSteps = failedSteps,
};
diff --git a/optimizerDuck/UI/ViewModels/Dialogs/LegalDialogViewModel.cs b/optimizerDuck/UI/ViewModels/Dialogs/LegalDialogViewModel.cs
index 958832b..44c57dd 100644
--- a/optimizerDuck/UI/ViewModels/Dialogs/LegalDialogViewModel.cs
+++ b/optimizerDuck/UI/ViewModels/Dialogs/LegalDialogViewModel.cs
@@ -1,6 +1,6 @@
using System.Collections.ObjectModel;
-using System.Globalization;
using System.Diagnostics;
+using System.Globalization;
using System.Windows;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
@@ -8,9 +8,9 @@ using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using optimizerDuck.Common.Helpers;
using optimizerDuck.Domain.Configuration;
-using Wpf.Ui.Appearance;
using optimizerDuck.Domain.UI;
using optimizerDuck.Services.Configuration;
+using Wpf.Ui.Appearance;
namespace optimizerDuck.UI.ViewModels.Dialogs;
@@ -26,8 +26,7 @@ public partial class LegalDialogViewModel(
[ObservableProperty]
private string _selectedCultureName = string.Empty;
- public ObservableCollection<LanguageOption> Languages { get; } =
- new(SupportedLanguages.All);
+ public ObservableCollection<LanguageOption> Languages { get; } = new(SupportedLanguages.All);
protected override Task InitializeOnceAsync()
{
@@ -37,7 +36,10 @@ public partial class LegalDialogViewModel(
return Task.CompletedTask;
}
- private void OnThemeChanged(ApplicationTheme currentApplicationTheme, System.Windows.Media.Color systemAccent)
+ private void OnThemeChanged(
+ ApplicationTheme currentApplicationTheme,
+ System.Windows.Media.Color systemAccent
+ )
{
if (CurrentApplicationTheme != currentApplicationTheme)
CurrentApplicationTheme = currentApplicationTheme;
@@ -63,6 +65,7 @@ public partial class LegalDialogViewModel(
Loc.Instance.ChangeCulture(new CultureInfo(value));
logger.LogInformation("Language changed to {Language} from LegalDialog", value);
}
+
partial void OnCurrentApplicationThemeChanged(
ApplicationTheme oldValue,
ApplicationTheme newValue
@@ -73,7 +76,10 @@ public partial class LegalDialogViewModel(
ApplicationThemeManager.Apply(newValue, updateAccent: false);
_ = SafeFireAndForgetAsync(
async () => await configManager.SetAsync(x => x.App.Theme, newValue),
- async () => await Application.Current.Dispatcher.InvokeAsync(() => CurrentApplicationTheme = oldValue)
+ async () =>
+ await Application.Current.Dispatcher.InvokeAsync(() =>
+ CurrentApplicationTheme = oldValue
+ )
);
}
diff --git a/optimizerDuck/UI/ViewModels/Optimizer/OptimizationCategoryViewModel.cs b/optimizerDuck/UI/ViewModels/Optimizer/OptimizationCategoryViewModel.cs
index 5ca299c..c40cb21 100644
--- a/optimizerDuck/UI/ViewModels/Optimizer/OptimizationCategoryViewModel.cs
+++ b/optimizerDuck/UI/ViewModels/Optimizer/OptimizationCategoryViewModel.cs
@@ -795,7 +795,10 @@ public partial class OptimizationCategoryViewModel : ViewModel
{
_snackbarService.Show(
Loc.Instance["RestorePoint.Snackbar.Success.Title"],
- Loc.Instance["RestorePoint.Snackbar.Success.Message", Shared.RestorePointName],
+ Loc.Instance[
+ "RestorePoint.Snackbar.Success.Message",
+ Shared.RestorePointName
+ ],
ControlAppearance.Success,
new SymbolIcon
{
diff --git a/optimizerDuck/UI/ViewModels/Pages/BloatwareViewModel.cs b/optimizerDuck/UI/ViewModels/Pages/BloatwareViewModel.cs
index e53b762..7c9d40e 100644
--- a/optimizerDuck/UI/ViewModels/Pages/BloatwareViewModel.cs
+++ b/optimizerDuck/UI/ViewModels/Pages/BloatwareViewModel.cs
@@ -257,7 +257,12 @@ public partial class BloatwareViewModel : ViewModel
viewModel.ProgressReporter.Report(
new ProcessingProgress
{
- Message = Loc.Instance["BloatwareDialog.Removing", item.Name, i + 1, toRemove.Count],
+ Message = Loc.Instance[
+ "BloatwareDialog.Removing",
+ item.Name,
+ i + 1,
+ toRemove.Count
+ ],
Total = toRemove.Count,
Value = i,
}
diff --git a/optimizerDuck/UI/ViewModels/Pages/DiskCleanupViewModel.cs b/optimizerDuck/UI/ViewModels/Pages/DiskCleanupViewModel.cs
index 3bfdd96..8a5e78a 100644
--- a/optimizerDuck/UI/ViewModels/Pages/DiskCleanupViewModel.cs
+++ b/optimizerDuck/UI/ViewModels/Pages/DiskCleanupViewModel.cs
@@ -147,7 +147,11 @@ public partial class DiskCleanupViewModel(
snackbarService.Show(
Loc.Instance["DiskCleanup.Complete.Title"],
- Loc.Instance["DiskCleanup.Complete.Message", CleanupItem.FormatBytes(freedBytes), $"{sw.Elapsed.TotalSeconds:0.0}s"],
+ Loc.Instance[
+ "DiskCleanup.Complete.Message",
+ CleanupItem.FormatBytes(freedBytes),
+ $"{sw.Elapsed.TotalSeconds:0.0}s"
+ ],
ControlAppearance.Success,
new SymbolIcon { Symbol = SymbolRegular.CheckmarkCircle24, Filled = true },
TimeSpan.FromSeconds(5)
@@ -191,7 +195,12 @@ public partial class DiskCleanupViewModel(
if (selectedItems.Count == 0)
return;
- var summaryText = Loc.Instance["DiskCleanup.Dialog.Confirmation.Summary", TotalSelectedSizeFormatted, SelectedCount, TotalSelectedFileCount];
+ var summaryText = Loc.Instance[
+ "DiskCleanup.Dialog.Confirmation.Summary",
+ TotalSelectedSizeFormatted,
+ SelectedCount,
+ TotalSelectedFileCount
+ ];
var dialogViewModel = new DiskCleanupConfirmationDialogViewModel(
selectedItems,
@@ -201,7 +210,10 @@ public partial class DiskCleanupViewModel(
{
Title = Loc.Instance["DiskCleanup.Dialog.Confirmation.Title", SelectedCount],
Content = new DiskCleanupConfirmationDialog { DataContext = dialogViewModel },
- PrimaryButtonText = Loc.Instance["DiskCleanup.Button.CleanSelected", TotalSelectedSizeFormatted],
+ PrimaryButtonText = Loc.Instance[
+ "DiskCleanup.Button.CleanSelected",
+ TotalSelectedSizeFormatted
+ ],
CloseButtonText = Loc.Instance["Common.Cancel"],
};
@@ -222,7 +234,11 @@ public partial class DiskCleanupViewModel(
snackbarService.Show(
Loc.Instance["DiskCleanup.Complete.Title"],
- Loc.Instance["DiskCleanup.Complete.Message", CleanupItem.FormatBytes(freedBytes), $"{sw.Elapsed.TotalSeconds:0.0}s"],
+ Loc.Instance[
+ "DiskCleanup.Complete.Message",
+ CleanupItem.FormatBytes(freedBytes),
+ $"{sw.Elapsed.TotalSeconds:0.0}s"
+ ],
ControlAppearance.Success,
new SymbolIcon { Symbol = SymbolRegular.CheckmarkCircle24, Filled = true },
TimeSpan.FromSeconds(5)
diff --git a/optimizerDuck/UI/ViewModels/Pages/SettingsViewModel.cs b/optimizerDuck/UI/ViewModels/Pages/SettingsViewModel.cs
index 58fc3ec..ae718fb 100644
--- a/optimizerDuck/UI/ViewModels/Pages/SettingsViewModel.cs
+++ b/optimizerDuck/UI/ViewModels/Pages/SettingsViewModel.cs
@@ -51,8 +51,7 @@ public partial class SettingsViewModel(
private bool _smoothScrolling;
public string Version { get; } = Shared.FileVersion;
- public ObservableCollection<LanguageOption> Languages { get; } =
- new(SupportedLanguages.All);
+ public ObservableCollection<LanguageOption> Languages { get; } = new(SupportedLanguages.All);
protected override Task InitializeOnceAsync()
{
diff --git a/optimizerDuck/UI/Windows/MainWindow.xaml.cs b/optimizerDuck/UI/Windows/MainWindow.xaml.cs
index 0c614af..4284b50 100644
--- a/optimizerDuck/UI/Windows/MainWindow.xaml.cs
+++ b/optimizerDuck/UI/Windows/MainWindow.xaml.cs
@@ -1,5 +1,7 @@
using System.Windows;
+using System.Windows.Controls;
using System.Windows.Data;
+using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using optimizerDuck.Domain.Abstractions;
@@ -13,8 +15,6 @@ using optimizerDuck.UI.Pages;
using optimizerDuck.UI.ViewModels.Windows;
using Wpf.Ui;
using Wpf.Ui.Abstractions;
-using System.Windows.Controls;
-using Microsoft.Extensions.DependencyInjection;
using Wpf.Ui.Controls;
namespace optimizerDuck.UI.Windows;
@@ -69,7 +69,8 @@ public partial class MainWindow : IWindow
if (!_appOptionsMonitor.CurrentValue.App.LegalAccepted)
{
- var legalDialog = (Application.Current as App)?.AppHost?.Services.GetService<LegalDialog>()
+ var legalDialog =
+ (Application.Current as App)?.AppHost?.Services.GetService<LegalDialog>()
?? new LegalDialog();
var dialog = new ContentDialog
@@ -79,9 +80,30 @@ public partial class MainWindow : IWindow
};
// Bind to Loc so title/buttons update when language changes inside the dialog
- dialog.SetBinding(ContentDialog.TitleProperty, new Binding("[LegalDialog.Title]") { Source = Loc.Instance, Mode = BindingMode.OneWay });
- dialog.SetBinding(ContentDialog.PrimaryButtonTextProperty, new Binding("[Button.Accept]") { Source = Loc.Instance, Mode = BindingMode.OneWay });
- dialog.SetBinding(ContentDialog.CloseButtonTextProperty, new Binding("[Button.Close]") { Source = Loc.Instance, Mode = BindingMode.OneWay });
+ dialog.SetBinding(
+ ContentDialog.TitleProperty,
+ new Binding("[LegalDialog.Title]")
+ {
+ Source = Loc.Instance,
+ Mode = BindingMode.OneWay,
+ }
+ );
+ dialog.SetBinding(
+ ContentDialog.PrimaryButtonTextProperty,
+ new Binding("[Button.Accept]")
+ {
+ Source = Loc.Instance,
+ Mode = BindingMode.OneWay,
+ }
+ );
+ dialog.SetBinding(
+ ContentDialog.CloseButtonTextProperty,
+ new Binding("[Button.Close]")
+ {
+ Source = Loc.Instance,
+ Mode = BindingMode.OneWay,
+ }
+ );
var result = await _contentDialogService.ShowAsync(dialog, CancellationToken.None);
if (result == ContentDialogResult.Primary)