Beispiel #1
0
        private void App_Exit(object sender, ExitEventArgs e)
        {
            try
            {
                MutexList.RemoveAll();
            }
            catch (Exception ex)
            {
                LogWriter.Log(ex, "Impossible to remove all mutexes of the opened projects.");
            }

            try
            {
                NotifyIcon?.Dispose();
            }
            catch (Exception ex)
            {
                LogWriter.Log(ex, "Impossible to dispose the system tray icon.");
            }

            try
            {
                EncodingManager.StopAllEncodings();
            }
            catch (Exception ex)
            {
                LogWriter.Log(ex, "Impossible to cancel all encodings.");
            }

            try
            {
                UserSettings.Save();
            }
            catch (Exception ex)
            {
                LogWriter.Log(ex, "Impossible to save the user settings.");
            }

            try
            {
                if (_mutex != null && _accepted)
                {
                    _mutex.ReleaseMutex();
                    _accepted = false;
                }
            }
            catch (Exception ex)
            {
                LogWriter.Log(ex, "Impossible to release the single instance mutex.");
            }

            try
            {
                HotKeyCollection.Default.Dispose();
            }
            catch (Exception ex)
            {
                LogWriter.Log(ex, "Impossible to dispose the hotkeys.");
            }
        }
Beispiel #2
0
        private void App_OnExit(object sender, ExitEventArgs e)
        {
            //TODO: Use a try catch for each one.

            MutexList.RemoveAll();

            UserSettings.Save();

            HotKeyCollection.Default.Dispose();
        }