[fxcop] image resizer ui (#6841)

* adjustments

* Settings fixed

* Getting resizing tests operational again

* fixed default vs loading from settings

* one small tewak
This commit is contained in:
Clint Rutkas
2020-10-01 11:33:23 -07:00
committed by GitHub
parent 19b519638f
commit c219fe0d1d
21 changed files with 141 additions and 112 deletions

View File

@@ -24,7 +24,7 @@ namespace ImageResizer
protected override void OnStartup(StartupEventArgs e)
{
var batch = ResizeBatch.FromCommandLine(Console.In, e.Args);
var batch = ResizeBatch.FromCommandLine(Console.In, e?.Args);
// TODO: Add command-line parameters that can be used in lieu of the input page (issue #14)
var mainWindow = new MainWindow(new MainViewModel(batch, Settings.Default));
@@ -34,12 +34,12 @@ namespace ImageResizer
BecomeForegroundWindow(new System.Windows.Interop.WindowInteropHelper(mainWindow).Handle);
}
private void BecomeForegroundWindow(IntPtr hWnd)
private static void BecomeForegroundWindow(IntPtr hWnd)
{
Win32Helpers.INPUT input = new Win32Helpers.INPUT { type = Win32Helpers.INPUTTYPE.INPUT_MOUSE, data = { } };
Win32Helpers.INPUT[] inputs = new Win32Helpers.INPUT[] { input };
Win32Helpers.SendInput(1, inputs, Win32Helpers.INPUT.Size);
Win32Helpers.SetForegroundWindow(hWnd);
NativeMethods.INPUT input = new NativeMethods.INPUT { type = NativeMethods.INPUTTYPE.INPUT_MOUSE, data = { } };
NativeMethods.INPUT[] inputs = new NativeMethods.INPUT[] { input };
_ = NativeMethods.SendInput(1, inputs, NativeMethods.INPUT.Size);
NativeMethods.SetForegroundWindow(hWnd);
}
}
}