mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 19:57:57 +01:00
Make DisplayChangeWatcher a partial class; add fields
The `DisplayChangeWatcher` class is now a partial class, enabling its definition to be split across multiple files. Added two private fields: `_dispatcherQueue` for managing thread-safe operations and `_debounceDelay` for debouncing with a 1-second delay. Updated the `DeviceWatcher` field to use nullable reference types (`DeviceWatcher?`).
This commit is contained in:
@@ -16,7 +16,7 @@ namespace PowerDisplay.Helpers;
|
||||
/// Watches for display/monitor connection changes using WinRT DeviceWatcher.
|
||||
/// Triggers DisplayChanged event when monitors are added, removed, or updated.
|
||||
/// </summary>
|
||||
public sealed class DisplayChangeWatcher : IDisposable
|
||||
public sealed partial class DisplayChangeWatcher : IDisposable
|
||||
{
|
||||
private readonly DispatcherQueue _dispatcherQueue;
|
||||
private readonly TimeSpan _debounceDelay = TimeSpan.FromSeconds(1);
|
||||
|
||||
Reference in New Issue
Block a user