mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
Refactor SettingsUtils and update project ID
Refactored `SettingsUtils` initialization across multiple files (`App.xaml.cs`, `MainWindow.xaml.cs`, `MainViewModel.cs`) to use `SettingsUtils.Default` instead of creating new instances. This improves consistency, reduces redundancy, and promotes better resource management. Updated the project ID for `PowerDisplayModuleInterface.vcxproj` in `PowerToys.slnx` to reflect a configuration or structural change in the project setup.
This commit is contained in:
@@ -655,7 +655,7 @@
|
||||
<Platform Solution="*|ARM64" Project="ARM64" />
|
||||
<Platform Solution="*|x64" Project="x64" />
|
||||
</Project>
|
||||
<Project Path="src/modules/powerdisplay/PowerDisplayModuleInterface/PowerDisplayModuleInterface.vcxproj" Id="a1b2c3d4-e5f6-7890-abcd-ef1234567890" />
|
||||
<Project Path="src/modules/powerdisplay/PowerDisplayModuleInterface/PowerDisplayModuleInterface.vcxproj" Id="d1234567-8901-2345-6789-abcdef012345" />
|
||||
</Folder>
|
||||
<Folder Name="/modules/PowerDisplay/Tests/">
|
||||
<Project Path="src/modules/powerdisplay/PowerDisplay.Lib.UnitTests/PowerDisplay.Lib.UnitTests.csproj">
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace PowerDisplay
|
||||
/// </summary>
|
||||
private const string ProcessReadyEventName = "Local\\PowerToys_PowerDisplay_Ready";
|
||||
|
||||
private readonly ISettingsUtils _settingsUtils = new SettingsUtils();
|
||||
private readonly ISettingsUtils _settingsUtils = SettingsUtils.Default;
|
||||
private Window? _mainWindow;
|
||||
private int _powerToysRunnerPid;
|
||||
private TrayIconService? _trayIconService;
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace PowerDisplay
|
||||
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.PublicMethods)]
|
||||
public sealed partial class MainWindow : WindowEx, IDisposable
|
||||
{
|
||||
private readonly ISettingsUtils _settingsUtils = new SettingsUtils();
|
||||
private readonly ISettingsUtils _settingsUtils = SettingsUtils.Default;
|
||||
private MainViewModel? _viewModel;
|
||||
private AppWindow? _appWindow;
|
||||
private bool _isExiting;
|
||||
|
||||
@@ -62,7 +62,7 @@ public partial class MainViewModel : INotifyPropertyChanged, IDisposable
|
||||
_isScanning = true;
|
||||
|
||||
// Initialize settings utils
|
||||
_settingsUtils = new SettingsUtils();
|
||||
_settingsUtils = SettingsUtils.Default;
|
||||
_stateManager = new MonitorStateManager();
|
||||
|
||||
// Initialize the monitor manager
|
||||
|
||||
Reference in New Issue
Block a user