Beispiel #1
0
        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            // Stop listening for devices
            DeviceListener.Instance.UnregisterDeviceNotification();
            DeviceListener.Instance.OnDevicesUpdated -= WindowsDevicesChanged;

            // Save preferences
            AppPrefs.Save();
        }
Beispiel #2
0
        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            if (!trayExit && (settingMinimizeOnClose.IsChecked ?? true))
            {
                this.Hide();
                trayIcon.Visible = true;
                e.Cancel         = true;
            }
            else
            {
                // Stop listening for devices
                DeviceListener.Instance.UnregisterDeviceNotification();
                DeviceListener.Instance.OnDevicesUpdated -= WindowsDevicesChanged;

                // Save preferences
                AppPrefs.Save();
            }
        }