예제 #1
0
        private void DisconnectedFromServer()
        {
            /*
             * if(!_connection.IsClosed && (_connection.Param is TCPTerminalParam)) {
             *                  string host = ((TCPTerminalParam)_connection.Param).Host;
             *                  string msg = String.Format(GEnv.Strings.GetString("Message.InterThread.Disconnected"), host);
             *                  if(GEnv.Options.DisconnectNotification==DisconnectNotification.MessageBox)
             *                          GUtil.Warning(GEnv.Frame, msg);
             *                  else if(GEnv.Options.DisconnectNotification==DisconnectNotification.StatusBar)
             *                          GEnv.Frame.SetStatusBarText(msg);
             *          }
             * */
            _connection.WriteChars("disconnected".ToCharArray());
            _connection.Close();

            /*
             * GEnv.Connections.FindTag(_connection).IsTerminated = true;
             *
             *          if(GEnv.Options.CloseOnDisconnect)
             *                  GEnv.GetConnectionCommandTarget(_connection).Close();
             *          else
             *                  GEnv.Frame.RefreshConnection(GEnv.Connections.FindTag(_connection));
             *
             *          if(GEnv.Options.QuitAppWithLastPane && GEnv.Connections.Count==0)
             *                  GEnv.Frame.AsForm().Close();
             */
        }
예제 #2
0
        public CommandResult Disconnect()
        {
            if (_connection.IsClosed)
            {
                return(CommandResult.Ignored);
            }

            if (GEnv.Options.CloseOnDisconnect)
            {
                Close();
            }
            else
            {
                _connection.Disconnect();
                _connection.Close();
                GEnv.Frame.RefreshConnection(GEnv.Connections.FindTag(_connection));
            }
            return(CommandResult.Success);
        }