[fxcop] Settings UI (#7559)

* Remove redundant default initializations

* Implement IDisposable in HotkeySettingsControl

* Mark classes and methods as static

* Move Interop.ShowWindow to NativeMethods class

* Fix string-related warnings

* Remove unused argument for KeyEventHandler

* Log caught general exceptions

* Use safe navigation operator for null argument checks

* Suppress CA2007 warnings and enable FxCop

* Suppress warning for unused event handler params

* Use TryParse in ImageResizerPage

* Use ConfigureAwait(false) for CA2007
This commit is contained in:
Luthfi Mawarid
2020-10-29 14:24:16 -07:00
committed by GitHub
parent 7ec2ff5513
commit 215c353dee
18 changed files with 120 additions and 65 deletions

View File

@@ -44,21 +44,21 @@ namespace Microsoft.PowerToys.Settings.UI.Runner
if (shellPage != null)
{
// send IPC Message
shellPage.SetDefaultSndMessageCallback(msg =>
ShellPage.SetDefaultSndMessageCallback(msg =>
{
// IPC Manager is null when launching runner directly
Program.GetTwoWayIPCManager()?.Send(msg);
});
// send IPC Message
shellPage.SetRestartAdminSndMessageCallback(msg =>
ShellPage.SetRestartAdminSndMessageCallback(msg =>
{
Program.GetTwoWayIPCManager().Send(msg);
System.Windows.Application.Current.Shutdown(); // close application
});
// send IPC Message
shellPage.SetCheckForUpdatesMessageCallback(msg =>
ShellPage.SetCheckForUpdatesMessageCallback(msg =>
{
Program.GetTwoWayIPCManager().Send(msg);
});
@@ -83,8 +83,8 @@ namespace Microsoft.PowerToys.Settings.UI.Runner
}
};
shellPage.SetElevationStatus(Program.IsElevated);
shellPage.SetIsUserAnAdmin(Program.IsUserAnAdmin);
ShellPage.SetElevationStatus(Program.IsElevated);
ShellPage.SetIsUserAnAdmin(Program.IsUserAnAdmin);
shellPage.Refresh();
}