public CommandResult CloseAll()
        {
            if (GApp.Options.AskCloseOnExit && GEnv.Connections.LiveConnectionsExist)
            {
                if (GUtil.AskUserYesNo(_frame, GApp.Strings.GetString("Message.AskExitEvenIfConnected"), MessageBoxIcon.Exclamation) == DialogResult.No)
                {
                    return(CommandResult.Cancelled);
                }
            }

            GEnv.Connections.CloseAllConnections();
            _frame.RemoveAllConnections();
            _frame.AdjustTerminalUI(false, null);
            GEnv.Connections.Clear();
            return(CommandResult.Success);
        }
Beispiel #2
0
        public virtual void ProcessMessage(IntPtr wParam, IntPtr lParam)
        {
            switch ((Service)(int)wParam)
            {
            case Service.Warning:
                GUtil.Warning(GEnv.Frame, _msg);
                break;

            case Service.Information:
                GUtil.Warning(GEnv.Frame, _msg, MessageBoxIcon.Information);
                break;

            case Service.AskUserYesNo:
                _dialogResult = GUtil.AskUserYesNo(GEnv.Frame, _msg);
                break;

            case Service.DisconnectedFromServer:
                DisconnectedFromServer();
                break;

            case Service.IndicateBell:
                GEnv.Frame.IndicateBell();
                break;

            case Service.CriticalError:
                GUtil.ReportCriticalError(_exception);
                break;

            case Service.InvalidCharDetected:                     //いまはこの3つはメッセージテキストでしか区別しない
            case Service.UnsupportedCharSetDetected:
            case Service.UnsupportedEscapeSequence:
            case Service.InvalidDocumentOperation:
                BadCharDetected();
                break;

            case Service.RefreshConnection:
                GEnv.Frame.RefreshConnection(GEnv.Connections.FindTag(_connection));
                break;
            }
        }