示例#1
0
        public ChangeLogDialog(TerminalConnection current)
        {
            //
            // Windows �t�H�[�� �f�U�C�i �T�|�[�g�ɕK�v�ł��B
            //
            InitializeComponent();
            this._logTypeLabel.Text = GApp.Strings.GetString("Form.ChangeLog._logTypeLabel");
            this._fileNameLabel.Text = GApp.Strings.GetString("Form.ChangeLog._fileNameLabel");
            this._cancelButton.Text = GApp.Strings.GetString("Common.Cancel");
            this._okButton.Text = GApp.Strings.GetString("Common.OK");
            this.Text = GApp.Strings.GetString("Form.ChangeLog.Text");

            //
            // TODO: InitializeComponent �Ăяo���̌�ɁA�R���X�g���N�^ �R�[�h��lj����Ă��������B
            //
            _connection = current;
            _logTypeBox.SelectedIndex = _logTypeBox.FindStringExact(EnumDescAttributeT.For(typeof(LogType)).GetDescription(_connection.LogType));

            if(_connection.LogType!=LogType.None) {
                _fileNameBox.Items.Add(_connection.LogPath);
                _fileNameBox.SelectedIndex = 0;
            }

            foreach(string p in GApp.ConnectionHistory.LogPaths)
                _fileNameBox.Items.Add(p);

            AdjustUI();
        }
示例#2
0
        public ServerInfo(TerminalConnection con)
        {
            //
            // Windows �t�H�[�� �f�U�C�i �T�|�[�g�ɕK�v�ł��B
            //
            InitializeComponent();

            //
            // TODO: InitializeComponent �Ăяo���̌�ɁA�R���X�g���N�^ �R�[�h��lj����Ă��������B
            //
            _serverNamesBox.Text = con.ServerName;
            _IPAddressBox.Text = con.ServerAddress==null? "" : con.ServerAddress.ToString();
            _protocolBox.Text = con.ProtocolDescription;
            _parameterBox.Lines = con.ConnectionParameter;
            _terminalTypeBox.Text = EnumDescAttributeT.For(typeof(TerminalType)).GetDescription(con.Param.TerminalType);
            string li = EnumDescAttributeT.For(typeof(LogType)).GetDescription(con.LogType);
            if(con.LogType!=LogType.None) li += "(" + con.LogPath + ")";
            _logBox.Text = li;
            _receiveBytes.Text = String.Format("{0,10}{1}", con.ReceivedDataSize, GApp.Strings.GetString("Caption.ServerInfo.BytesReceived"));
            _transmitBytes.Text = String.Format("{0,10}{1}", con.SentDataSize, GApp.Strings.GetString("Caption.ServerInfo.BytesSent"));

            this._okButton.Text = GApp.Strings.GetString("Common.OK");
            this._serverNamesLabel.Text = GApp.Strings.GetString("Form.ServerInfo._serverNamesLabel");
            this._IPAddressLabel.Text = GApp.Strings.GetString("Form.ServerInfo._IPAddressLabel");
            this._protocolLabel.Text = GApp.Strings.GetString("Form.ServerInfo._protocolLabel");
            this._terminalTypeLabel.Text = GApp.Strings.GetString("Form.ServerInfo._terminalTypeLabel");
            this._parameterLabel.Text = GApp.Strings.GetString("Form.ServerInfo._parameterLabel");
            this._statsLabel.Text = GApp.Strings.GetString("Form.ServerInfo._statsLabel");
            this._logLabel.Text = GApp.Strings.GetString("Form.ServerInfo._logLabel");
            this.Text = GApp.Strings.GetString("Form.ServerInfo.Text");
        }
示例#3
0
 public void DisconnectedFromServer(TerminalConnection con)
 {
     lock(this) {
         _connection = con;
         SendMessageCore(Service.DisconnectedFromServer);
     }
 }
示例#4
0
 public void CloseConnection(ConnectionTag tag)
 {
     _connection = tag.Connection;
     lock(this) {
         SendMessageCore(CService.CloseConnection);
     }
 }
示例#5
0
 public void ActivateConnection(ConnectionTag tag)
 {
     lock(this) {
         _connection = tag.Connection;
         SendMessageCore(CService.ActivateConnection);
     }
 }
示例#6
0
 internal TerminalDocument(TerminalConnection con)
 {
     _connection = con;
     Clear();
     _scrollingTop = -1;
     _scrollingBottom = -1;
 }
示例#7
0
        public LineFeedStyleDialog(TerminalConnection con)
        {
            //
            // Windows �t�H�[�� �f�U�C�i �T�|�[�g�ɕK�v�ł��B
            //
            InitializeComponent();

            //
            // TODO: InitializeComponent �Ăяo���̌�ɁA�R���X�g���N�^ �R�[�h��lj����Ă��������B
            //
            this._cancelButton.Text = GApp.Strings.GetString("Common.Cancel");
            this._okButton.Text = GApp.Strings.GetString("Common.OK");
            this._lineFeedLabel.Text = GApp.Strings.GetString("Form.LineFeedStyleDialog._lineFeedLabel");
            this.Text = GApp.Strings.GetString("Form.LineFeedStyleDialog.Text");
            this._lineFeedBox.Items.AddRange(EnumDescAttributeT.For(typeof(LineFeedRule)).DescriptionCollection());
            this._lineFeedBox.SelectedIndex = (int)con.Param.LineFeedRule;
        }
 public InternalLoggerT(ITerminalTextLogger l, TerminalConnection p)
 {
     _parent = p;
     _logger = l;
 }
 public InternalLoggerB(ITerminalBinaryLogger l, TerminalConnection p)
 {
     _parent = p;
     _logger = l;
 }
示例#10
0
        public ConnectionTag(TerminalConnection c)
        {
            _connection = c;
            _pane = null;
            _invalidateParam = new InvalidateParam();
            _tabButton = null;
            _document = new TerminalDocument(_connection);
            _receiver = new TerminalDataReceiver(this);
            _terminated = false;
            _timer = null;
            _windowTitle = "";

            //null�̂Ƃ��̓f�t�H���g�v���t�@�C����g��
            _renderProfile = c.Param.RenderProfile;

            //VT100�w��ł�xterm�V�[�P���X�𑗂��Ă���A�v���P�[�V�������������Ȃ��̂�
            //_terminal = new XTerm(this, new JapaneseCharDecoder(_connection));

            if(c.Param.TerminalType==TerminalType.XTerm || c.Param.TerminalType==TerminalType.KTerm)
                _terminal = new XTerm(this, new JapaneseCharDecoder(_connection));
            else
                _terminal = new VT100Terminal(this, new JapaneseCharDecoder(_connection));

            GEnv.Connections.KeepAlive.SetTimerToConnectionTag(this);
        }
示例#11
0
 public void EnableTerminalUI(bool enabled, TerminalConnection con)
 {
     _blockEventHandler = true;
     _saveShortcut.Enabled = enabled;
     _newLineOption.Enabled = enabled && !con.IsClosed;
     _logSuspend.Enabled = enabled && !con.IsClosed && con.TextLogger.IsActive;
     _localEcho.Enabled = enabled && !con.IsClosed;
     _lineFeedRule.Enabled = enabled && !con.IsClosed;
     _encodingBox.Enabled = enabled && !con.IsClosed;
     _serverInfo.Enabled = enabled;
     _commentLog.Enabled = enabled && !con.IsClosed && con.TextLogger.IsActive;
     if(enabled) {
         _newLineOption.SelectedIndex = (int)con.Param.TransmitNL;
         _encodingBox.SelectedIndex = (int)con.Param.EncodingProfile.Type;
         _logSuspend.Checked = con.LogSuspended;
         _localEcho.Checked = con.Param.LocalEcho;
     }
     _blockEventHandler = false;
     Invalidate(true);
 }
示例#12
0
 public PosCheck(int pi)
 {
     _positionIndex = pi;
     _ignore = null;
 }
 public ContainerConnectionCommandTarget(TerminalConnection con)
     : base(con)
 {
 }
示例#14
0
 internal void AdjustContextMenu(bool enabled, TerminalConnection con)
 {
     Menu.MenuItemCollection col = this.ContextMenu.MenuItems;
     col[0].Enabled = !GEnv.TextSelection.IsEmpty && GEnv.TextSelection.Owner.Connection==con;
     col[1].Enabled = !con.IsClosed && CanPaste();
     AdjustConsoleMenu(col, enabled, con, 3); //�R�s�[�A�y�[�X�g�A��؂���̐悪�R���\�[�����j���[
 }
示例#15
0
 public void RefreshConnection(ConnectionTag tag)
 {
     TerminalDocument doc = tag.Document;
     Monitor.Exit(doc);
     lock(this) {
         _connection = tag.Connection;
         SendMessageCore(Service.RefreshConnection);
     }
     Monitor.Enter(doc);
 }
示例#16
0
 public void SetPanePosition(ConnectionTag tag, PanePosition pos)
 {
     lock(this) {
         _connection = tag.Connection;
         _destinationPanePosition = pos;
         SendMessageCore(CService.SetPanePosition);
     }
 }
示例#17
0
 public void ApplyParam(TerminalConnection con)
 {
     _con = con;
     SerialTerminalParam param = (SerialTerminalParam)con.Param;
     _portBox.Text = "COM"+param.Port;
     _baudRateBox.SelectedIndex = _baudRateBox.FindStringExact(param.BaudRate.ToString());
     _dataBitsBox.SelectedIndex = param.ByteSize==7? 0 : 1;
     _parityBox.SelectedIndex = (int)param.Parity;
     _stopBitsBox.SelectedIndex = (int)param.StopBits;
     _flowControlBox.SelectedIndex = (int)param.FlowControl;
     _transmitDelayPerCharBox.Text = param.TransmitDelayPerChar.ToString();
     _transmitDelayPerLineBox.Text = param.TransmitDelayPerLine.ToString();
 }
示例#18
0
 public ConnectionCommandTarget(TerminalConnection con)
 {
     _connection = con;
 }
示例#19
0
 internal static ConnectionCommandTarget GetConnectionCommandTarget(TerminalConnection con)
 {
     return new ConnectionCommandTarget(con);
 }
示例#20
0
        private void AdjustConsoleMenu(Menu.MenuItemCollection target, bool enabled, TerminalConnection con, int baseIndex)
        {
            target[baseIndex + _menuServerInfo.Index].Enabled = enabled;
            target[baseIndex + _menuLocalEcho.Index].Enabled = enabled && !con.IsClosed;
            target[baseIndex + _menuLineFeedRule.Index].Enabled = enabled && !con.IsClosed;
            target[baseIndex + _menuEncoding.Index].Enabled = enabled && !con.IsClosed;
            target[baseIndex + _menuConsoleClose.Index].Enabled = enabled;
            //�����ƍĐڑ��͓���͂قƂ�Ljꏏ
            target[baseIndex + _menuConsoleReproduce.Index].Enabled = enabled;
            target[baseIndex + _menuConsoleReproduce.Index].Text = GApp.Strings.GetString((con!=null && con.IsClosed)? "Menu._menuConsoleRevive" : "Menu._menuConsoleReproduce");
            target[baseIndex + _menuSendSpecial.Index].Enabled = enabled && !con.IsClosed;
            target[baseIndex + _menuNewLine.Index].Enabled = enabled && !con.IsClosed;
            target[baseIndex + _menuCommentLog.Index].Enabled = enabled && !con.IsClosed && con.TextLogger.IsActive;
            target[baseIndex + _menuSuspendLog.Index].Enabled = enabled && !con.IsClosed && con.TextLogger.IsActive;
            target[baseIndex + _menuChangeLog.Index].Enabled = enabled && !con.IsClosed;
            target[baseIndex + _menuEditRenderProfile.Index].Enabled = enabled;
            target[baseIndex + _menuRenameTab.Index].Enabled = enabled && !con.IsClosed;

            Menu.MenuItemCollection nls = target[baseIndex + _menuSendSpecial.Index].MenuItems;
            nls[_menuSerialConfig.Index].Enabled = enabled && (con is SerialTerminalConnection);
            nls[_menuResetTerminal.Index].Enabled = enabled && !con.IsClosed;

            if(enabled) {
                target[baseIndex + _menuLocalEcho.Index].Checked = con.Param.LocalEcho;
                target[baseIndex + _menuSuspendLog.Index].Checked = con.LogSuspended;

                nls = target[baseIndex + _menuNewLine.Index].MenuItems;
                nls[_menuNewLine_CR.Index].Checked = (con.Param.TransmitNL==NewLine.CR);
                nls[_menuNewLine_LF.Index].Checked = (con.Param.TransmitNL==NewLine.LF);
                nls[_menuNewLine_CRLF.Index].Checked = (con.Param.TransmitNL==NewLine.CRLF);

                nls = target[baseIndex + _menuEncoding.Index].MenuItems;
                for(int i=0; i<nls.Count; i++) {
                    nls[i].Checked = (i==(int)con.Param.EncodingProfile.Type);
                }
            }
        }
        //Activate�̏������́AGEnc.Coonections�������ActiveConnection�͌Â���‚ł���B
        public CommandResult ActivateConnection(TerminalConnection con)
        {
            if(con==GEnv.Connections.ActiveConnection) {
                IPoderosaTerminalPane p = GEnv.Connections.FindTag(con).AttachedPane;
                if(p!=null && !p.AsControl().Focused) p.AsControl().Focus(); //!!�A�N�e�B�u�ȃR�l�N�V����������Pane��null���Ă��Ƃ͂Ȃ��͂������A�����Ȃ��Ă��܂��P�[�X������悤���B�^�̌����͕ʂɂ���͂���������
                return CommandResult.Success;
            }

            return ActivateConnection2(con==null? null : GEnv.Connections.FindTag(con));
        }
示例#22
0
 public ConnectionTag FindTag(TerminalConnection con)
 {
     foreach(ConnectionTag t in _connections) {
         if(t.Connection==con) return t;
     }
     return null;
 }
示例#23
0
 //_ignore�ɓ������ڑ��̓}�b�`���Ȃ��Ɣ���
 public PosCheck(int pi, TerminalConnection ig)
 {
     _positionIndex = pi;
     _ignore = ig;
 }
示例#24
0
        public JapaneseCharDecoder(TerminalConnection con)
        {
            _jisbuf = new MemoryStream(0x1000);
            _state = State.Normal;
            _connection = con;
            _encoding = con.Param.EncodingProfile;

            _iso2022jpByteProcessor   = new ByteProcessor(this.ProcessByteAsISO2022JP);
            _DECLineByteProcessor     = new ByteProcessor(this.ProcessByteAsDECLine);
            _currentByteProcessor = null;
            _G0ByteProcessor = null;
            _G1ByteProcessor = null;
        }
示例#25
0
 public int IndexOf(TerminalConnection con)
 {
     int i = 0;
     foreach(ConnectionTag t in _connections) {
         if(t.Connection==con) return i;
         i++;
     }
     return -1;
 }
 public InternalLoggerT(ITerminalTextLogger l, TerminalConnection p, string controlName)
 {
     //edited by xavier: added controlname
     _parent = p;
     _logger = l;
     _controlName = controlName;//edited by xavier: added controlname
 }
示例#27
0
文件: GApp.cs 项目: nospy/EasyConnect
 public static ContainerConnectionCommandTarget GetConnectionCommandTarget(TerminalConnection con)
 {
     return new ContainerConnectionCommandTarget(con);
 }
示例#28
0
        internal void Remove(TerminalConnection con)
        {
            int i = IndexOf(con);
            if(i==-1) return; //�{���͂��������̂͂�낵���Ȃ���

            ConnectionTag ct = this.TagAt(i);
            _connections.RemoveAt(i);
            _activatedOrder.Remove(ct);
            _activeIndex = Math.Min(_activeIndex, _connections.Count-1);
        }