Skip to content

Commit d508b08

Browse files
committed
convert SystemParameters from params string[] to params ReadOnlySpan<string>
1 parent 44c85f2 commit d508b08

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/SystemParameters.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
using System.ComponentModel;
88
using System.Diagnostics.CodeAnalysis;
99
using System.Runtime.InteropServices;
10-
using System.Security;
1110
using System.Windows.Controls.Primitives;
1211
using System.Windows.Media;
1312
using Microsoft.Win32;
@@ -73,16 +72,16 @@ public enum PowerLineStatus
7372
/// </summary>
7473
public static class SystemParameters
7574
{
76-
public static event System.ComponentModel.PropertyChangedEventHandler StaticPropertyChanged;
75+
public static event PropertyChangedEventHandler StaticPropertyChanged;
7776

78-
private static void OnPropertiesChanged(params string[] propertyNames)
77+
private static void OnPropertiesChanged(params ReadOnlySpan<string> propertyNames)
7978
{
80-
System.ComponentModel.PropertyChangedEventHandler handler = StaticPropertyChanged;
81-
if (handler != null)
79+
PropertyChangedEventHandler handler = StaticPropertyChanged;
80+
if (handler is not null)
8281
{
83-
for (int i=0; i<propertyNames.Length; ++i)
82+
foreach (string propertyName in propertyNames)
8483
{
85-
handler(null, new System.ComponentModel.PropertyChangedEventArgs(propertyNames[i]));
84+
handler.Invoke(null, new PropertyChangedEventArgs(propertyName));
8685
}
8786
}
8887
}

0 commit comments

Comments
 (0)