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);
}
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); }