diff options
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);
- }
}
}
|