protected override void OnClosing(System.ComponentModel.CancelEventArgs e) { //clean up notifyicon (would otherwise stay open until application finishes) MyNotifyIcon.Dispose(); base.OnClosing(e); }
private void Window_Closing(object sender, CancelEventArgs e) { _timer.Enabled = false; if (MainWindow.keeperSettings.SaveOnClose == true) { forceSave(); } MyNotifyIcon.Dispose(); }
protected override void OnClosing(System.ComponentModel.CancelEventArgs e) { //clean up notifyicon (would otherwise stay open until application finishes) MyNotifyIcon.Dispose(); if (!tcpServerStopped) { serverStateButton_Click(null, null); } base.OnClosing(e); }
protected override void OnClosing(CancelEventArgs e) { if (_isClose) { //clean up notifyicon (would otherwise stay open until application finishes) MyNotifyIcon.Dispose(); _dispatcherTimer.Stop(); _dispatcherTimer = null; base.OnClosing(e); } else { ShowInTaskbar = false; Visibility = Visibility.Hidden; e.Cancel = true; } }
/// <summary> /// Dispose clipboard monitor, notify icon and other things /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void DisposeSomethings(object sender, RoutedEventArgs e) { try { // unset clipboard text changed event handler _clipboardMonitor.ClipboardTextChanged -= ClipboardEnviroment.ClipboardTextChanged; // unset clipboard image changed event handler _clipboardMonitor.ClipboardImageChanged -= ClipboardEnviroment.ClipboardImageChanged; // diposing monitor _clipboardMonitor.Dispose(); } catch (Exception exp) { MessageBox.Show(exp.ToString(), "Klavye - Fare Dinleyici Hata", MessageBoxButton.OK, MessageBoxImage.Error); } finally { MyNotifyIcon.Dispose(); } }
protected override void OnClosing(CancelEventArgs e) { MyNotifyIcon.Dispose(); base.OnClosing(e); }
protected override void OnClosing(System.ComponentModel.CancelEventArgs e) { MyNotifyIcon.Dispose(); base.OnClosing(e); }
private void MetroWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) { MyNotifyIcon.Dispose(); SaveSettings(); Save(); }