Commit Graph

3 Commits

Author SHA1 Message Date
Yu Leng
12916deca0 Refactor: Simplify codebase and remove unused methods
Removed unused methods across multiple files, including `GetContrastAsync`, `GetVolumeAsync`, and `SaveCurrentSettingsAsync` in `DdcCiController.cs` and `WmiController.cs`. Simplified the `IMonitorController` interface by removing redundant methods.

Replaced `ProcessThemeChangeAsync` with a synchronous `ProcessThemeChange` in `LightSwitchListener.cs`. Changed `ParseVcpCodesToIntegers` visibility to private in `MonitorFeatureHelper.cs` and removed related helper methods.

Eliminated retry logic by removing `ExecuteWithRetryAsync` in `RetryHelper.cs`. Simplified `SetBrightnessAsync` in `MonitorManager.cs` using a generic helper. Streamlined `DisplayName` in `MonitorViewModel.cs` and removed unnecessary property change notifications.

These changes reduce complexity, improve maintainability, and streamline the codebase by removing unused or redundant functionality.
2025-11-27 22:43:28 +08:00
Yu Leng
de44da04de Refactor and enhance monitor control logic
- Consolidated brightness and capabilities retrieval logic with `GetBrightnessInfoCore` and `RetryHelper` for improved modularity and resiliency.
- Introduced `LockedDictionary` for thread-safe dictionary operations, replacing manual locking in `PhysicalMonitorHandleManager` and `MonitorStateManager`.
- Refactored monitor discovery in `MonitorManager` to separate discovery, initialization, and validation steps for better maintainability.
- Simplified event registration in `App.xaml.cs` with helper methods to reduce repetitive code.
- Enhanced VCP code handling with new methods for formatted and sorted VCP code retrieval.
- Added `SuspendNotifications` in `MonitorInfo` to optimize batch property updates and improve UI performance.
- Simplified parameter update methods in `MonitorViewModel` by removing redundant `fromProfile` logic.
- Improved state management with synchronous save support and reusable JSON building logic in `MonitorStateManager`.
- Updated UI bindings in `ProfileEditorDialog.xaml` and improved VCP code display in `MainViewModel`.
- Cleaned up redundant code, improved logging, and standardized method naming for better readability and maintainability.
2025-11-26 05:02:49 +08:00
Yu Leng
580651b47a Refactor PowerDisplay module and add shared library
Introduced `PowerDisplay.Lib` to centralize shared logic and models, improving modularity and reusability. Refactored namespaces, moving classes to `PowerDisplay.Common`. Added utilities like `ColorTemperatureHelper` and `MonitorFeatureHelper` for consistent logic.

Replaced `ProfileManager` with `ProfileService` for centralized profile management. Enhanced event handling, monitor state management, and settings synchronization. Improved color temperature handling and feature detection.

Removed redundant code and converters. Updated `Settings.UI.Library` and XAML bindings to use shared models. Enhanced logging, serialization, and disposal logic. Updated project files and added documentation for better maintainability.
2025-11-24 18:08:11 +08:00