Smuxi.Frontend.Stfl.Frontend.Quit C# (CSharp) Method

Quit() public static method

public static Quit ( ) : void
return void
        public static void Quit()
        {
            if (_FrontendManager != null) {
                _FrontendManager.IsFrontendDisconnecting = true;
                if (IsLocalEngine) {
                    try {
                        // we don't shutdown the remote session
                        Session.Shutdown();
                    } catch (Exception ex) {
            #if LOG4NET
                        _Logger.Error("Quit(): Exception", ex);
            #endif
                    }
                } else if (EngineManager != null) {
                    EngineManager.Disconnect();
                }
            }

            /*
            BUG: don't do this, the access to config is lost and the entry will
            throw an exception then.
            if (_FrontendManager != null) {
                DisconnectEngineFromGUI();
            }
            */

            MainWindow.Reset();
            Environment.Exit(0);
        }

Usage Example

示例#1
0
文件: Entry.cs 项目: shubhtr/smuxi
        private bool Command(CommandModel cmd)
        {
            bool handled = false;

            if (cmd.IsCommand)
            {
                switch (cmd.Command.ToLower())
                {
                case "help":
                    CommandHelp(cmd);
                    break;

                case "window":
                    CommandWindow(cmd);
                    handled = true;
                    break;

                case "exit":
                    Frontend.Quit();
                    handled = true;
                    break;

                case "gc":
#if LOG4NET
                    _Logger.Debug("GC.Collect()");
#endif
                    var msg = new MessageBuilder().
                              AppendEventPrefix().
                              AppendText("GCing...").
                              ToMessage();
                    cmd.FrontendManager.AddMessageToChat(cmd.Chat, msg);
                    GC.Collect();
                    handled = true;
                    break;

                case "generate_messages":
                    CommandGenerateMessages(cmd);
                    handled = true;
                    break;
                }
            }
            return(handled);
        }
All Usage Examples Of Smuxi.Frontend.Stfl.Frontend::Quit