mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 18:57:19 +02:00
[fxcop] Settings UI library (part 2) (#7257)
* Suppress warnings for read-only collection properties (see code comments) * Call ConfigureAwait on tasks * Add CultureInfo and StringComparison policy for certain string operations * Add checks and exceptions for null arguments to public methods * Rename RaisePropertyChanged to NotifyPropertyChanged * Suppress CA1000 warning on SettingsRepository class * Implement Disposable pattern in HotkeySettingsControlHook * Modify null argument handling in KeyboardManagerViewModel::CombineShortcutLists
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
@@ -24,7 +25,15 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
|
||||
public bool Compare(AppSpecificKeysDataModel arg)
|
||||
{
|
||||
return OriginalKeys.Equals(arg.OriginalKeys) && NewRemapKeys.Equals(arg.NewRemapKeys) && TargetApp.Equals(arg.TargetApp);
|
||||
if (arg == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(arg));
|
||||
}
|
||||
|
||||
// Using Ordinal comparison for internal text
|
||||
return OriginalKeys.Equals(arg.OriginalKeys, StringComparison.Ordinal) &&
|
||||
NewRemapKeys.Equals(arg.NewRemapKeys, StringComparison.Ordinal) &&
|
||||
TargetApp.Equals(arg.TargetApp, StringComparison.Ordinal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user