Esempio n. 1
0
        public void CloseApp()
        {
            try
            {
                this.Logger.Trace("begin.");

                // サーバを終了する
                RemoteTTSServer.Instance.Close();
                BoyomiTcpServer.Instance.Stop();

                if (this.taskTrayComponet != null)
                {
                    this.taskTrayComponet.Dispose();
                    this.taskTrayComponet = null;
                }

                Config.Instance.Save();
            }
            catch (Exception ex)
            {
                var message = "App exit error";
                this.Logger.Fatal(ex, message);
                ShowMessageBoxException(message, ex);
            }
            finally
            {
                AssemblyResolver.Free();
                this.Logger.Trace("end.");
            }
        }
Esempio n. 2
0
        private void App_Exit(object sender, ExitEventArgs e)
        {
            try
            {
                this.Logger.Trace("begin.");

                // サーバを終了する
                RemoteTTSServer.Instance.Close();

                if (this.taskTrayComponet != null)
                {
                    this.taskTrayComponet.Dispose();
                    this.taskTrayComponet = null;
                }
            }
            catch (Exception ex)
            {
                var message = "App exit error";
                this.Logger.Fatal(ex, message);
                ShowMessageBoxException(message, ex);
            }
            finally
            {
                AssemblyResolver.Free();
                this.Logger.Trace("end.");
            }
        }
Esempio n. 3
0
        private void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
        {
            try
            {
                var message = "Dispatcher Unhandled Exception";

                try
                {
                    this.Logger.Fatal(e.Exception, message);
                    LogManager.Flush();

                    // サーバを終了する
                    RemoteTTSServer.Instance.Close();
                    BoyomiTcpServer.Instance.Stop();

                    if (this.taskTrayComponet != null)
                    {
                        this.taskTrayComponet.HideNotifyIcon();
                        this.taskTrayComponet.Dispose();
                        this.taskTrayComponet = null;
                    }
                }
                catch (Exception)
                {
                }

                ShowMessageBoxException(message, e.Exception);
            }
            finally
            {
                Application.Current.Shutdown();
            }
        }