diff options
author | sr55 <[email protected]> | 2017-03-26 11:57:57 +0100 |
---|---|---|
committer | sr55 <[email protected]> | 2017-03-26 11:57:57 +0100 |
commit | 6402bd62a09790377fa76868bed361ffa9b5c810 (patch) | |
tree | 99629d78f89f4dac2fca036e0e85cdbadb4f6f8e /win/CS/HandBrakeWPF/Views/ShellView.xaml.cs | |
parent | b13c230613ae2092a5ce6f699df10a93f400cff6 (diff) |
WinGui: Fix a number of stylecop warnings.
Diffstat (limited to 'win/CS/HandBrakeWPF/Views/ShellView.xaml.cs')
-rw-r--r-- | win/CS/HandBrakeWPF/Views/ShellView.xaml.cs | 57 |
1 files changed, 27 insertions, 30 deletions
diff --git a/win/CS/HandBrakeWPF/Views/ShellView.xaml.cs b/win/CS/HandBrakeWPF/Views/ShellView.xaml.cs index c1a45a58f..6fe0187bc 100644 --- a/win/CS/HandBrakeWPF/Views/ShellView.xaml.cs +++ b/win/CS/HandBrakeWPF/Views/ShellView.xaml.cs @@ -45,14 +45,11 @@ namespace HandBrakeWPF.Views {
this.InitializeComponent();
-
-
IUserSettingService userSettingService = IoC.Get<IUserSettingService>();
bool minimiseToTray = userSettingService.GetUserSetting<bool>(UserSettingConstants.MainWindowMinimize);
if (minimiseToTray)
{
-
INotifyIconService notifyIconService = IoC.Get<INotifyIconService>();
this.notifyIcon = new NotifyIcon();
this.notifyIcon.ContextMenu = new ContextMenu(new[] { new MenuItem("Restore", NotifyIconClick), new MenuItem("Mini Status Display", ShowMiniStatusDisplay) });
@@ -87,6 +84,33 @@ namespace HandBrakeWPF.Views }
/// <summary>
+ /// Check with the user before closing.
+ /// </summary>
+ /// <param name="e">
+ /// The CancelEventArgs.
+ /// </param>
+ protected override void OnClosing(CancelEventArgs e)
+ {
+ IShellViewModel shellViewModel = this.DataContext as IShellViewModel;
+
+ if (shellViewModel != null)
+ {
+ bool canClose = shellViewModel.CanClose();
+ if (!canClose)
+ {
+ e.Cancel = true;
+ }
+ }
+
+ if (this.notifyIcon != null)
+ {
+ this.notifyIcon.Visible = false;
+ }
+
+ base.OnClosing(e);
+ }
+
+ /// <summary>
/// The show mini status display.
/// </summary>
/// <param name="sender">
@@ -146,32 +170,5 @@ namespace HandBrakeWPF.Views }
}
}
-
- /// <summary>
- /// Check with the user before closing.
- /// </summary>
- /// <param name="e">
- /// The CancelEventArgs.
- /// </param>
- protected override void OnClosing(CancelEventArgs e)
- {
- IShellViewModel shellViewModel = this.DataContext as IShellViewModel;
-
- if (shellViewModel != null)
- {
- bool canClose = shellViewModel.CanClose();
- if (!canClose)
- {
- e.Cancel = true;
- }
- }
-
- if (this.notifyIcon != null)
- {
- this.notifyIcon.Visible = false;
- }
-
- base.OnClosing(e);
- }
}
}
|