mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 10:46:33 +02:00
Use collection expressions
This commit is contained in:
@@ -30,7 +30,7 @@ internal sealed class OpenWindows
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// List of all the open windows
|
/// List of all the open windows
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private readonly List<Window> windows = new();
|
private readonly List<Window> windows = [];
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An instance of the class OpenWindows
|
/// An instance of the class OpenWindows
|
||||||
@@ -40,7 +40,7 @@ internal sealed class OpenWindows
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the list of all open windows
|
/// Gets the list of all open windows
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal List<Window> Windows => new(windows);
|
internal List<Window> Windows => [..windows];
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets an instance property of this class that makes sure that
|
/// Gets an instance property of this class that makes sure that
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ public class VirtualDesktopHelper
|
|||||||
using var virtualDesktopKey = Registry.CurrentUser.OpenSubKey(registryExplorerVirtualDesktops, false);
|
using var virtualDesktopKey = Registry.CurrentUser.OpenSubKey(registryExplorerVirtualDesktops, false);
|
||||||
if (virtualDesktopKey is not null)
|
if (virtualDesktopKey is not null)
|
||||||
{
|
{
|
||||||
var allDeskValue = (byte[]?)virtualDesktopKey.GetValue("VirtualDesktopIDs", null) ?? Array.Empty<byte>();
|
var allDeskValue = (byte[]?)virtualDesktopKey.GetValue("VirtualDesktopIDs", null) ?? [];
|
||||||
if (allDeskValue is not null)
|
if (allDeskValue is not null)
|
||||||
{
|
{
|
||||||
// We clear only, if we can read from registry. Otherwise, we keep the existing values.
|
// We clear only, if we can read from registry. Otherwise, we keep the existing values.
|
||||||
|
|||||||
Reference in New Issue
Block a user