コード例 #1
0
        public AbstractTerminal(TerminalInitializeInfo info)
        {
            //TerminalEmulatorPlugin.Instance.LaterInitialize();
            _session = info.Session;

            // //_invalidateParam = new InvalidateParam();
            _document = new TerminalDocument(info.InitialWidth, info.InitialHeight);
            //_document.SetOwner(_session.ISession);
            _afterExitLockActions = new List <AfterExitLockDelegate>();

            _decoder      = new ISO2022CharDecoder(this, EncodingProfile.Get(info.Session.TerminalSettings.Encoding));
            _terminalMode = TerminalMode.Normal;
            _logService   = new LogService(info.TerminalParameter, _session.TerminalSettings, _session.TerminalOptions);
            //_promptRecognizer = new PromptRecognizer(this);

            //if (info.Session.TerminalSettings.LogSettings != null)
            //{
            //    _logService.ApplyLogSettings(_session.TerminalSettings.LogSettings, false);
            //}

            //event handlers
            ITerminalSettings ts = info.Session.TerminalSettings;

            ts.ChangeEncoding  += delegate(EncodingType t) { this.Reset(); };
            _document.DebugFlag = ts.DebugFlag;

            _document.LineFeedRule = GetTerminalSettings().LineFeedRule; //(Telnet.LineFeedRule)
            //ToDo: Set Encoding
            //_document.Encoding = Encoding.GetEncoding("iso-2022-jp")
        }
コード例 #2
0
 //‚±‚ê‚̓ƒCƒ“ƒXƒŒƒbƒh‚©‚çŒÄ‚яo‚·‚±‚Æ
 public virtual void FullReset()
 {
     lock (_document) {
         ChangeMode(TerminalMode.Normal);
         _document.ClearScrollingRegion();
         ResetInternal();
         _decoder = new ISO2022CharDecoder(this, EncodingProfile.Get(GetTerminalSettings().Encoding));
     }
 }
コード例 #3
0
 public void Reset()
 {
     //Encoding‚ª“¯‚¶Žž‚ÍŠÈ’P‚ɍς܂¹‚邱‚Æ‚ª‚Å‚«‚é
     if (_decoder.CurrentEncoding.Type == GetTerminalSettings().Encoding)
     {
         _decoder.Reset(_decoder.CurrentEncoding);
     }
     else
     {
         _decoder = new ISO2022CharDecoder(this, EncodingProfile.Get(GetTerminalSettings().Encoding));
     }
 }
コード例 #4
0
 public void InvalidCharDetected(byte[] buf)
 {
     CharDecodeError(String.Format("Message.AbstractTerminal.UnexpectedChar", EncodingProfile.Get(GetTerminalSettings().Encoding).Encoding.WebName));
 }
コード例 #5
0
 //‰üs‚Í“ü‚Á‚Ä‚¢‚È‚¢‘O’ñ‚Å
 /// <summary>
 /// <ja>
 /// CharŒ^‚Ì”z—ñ‚𑗐M‚µ‚Ü‚·B
 /// </ja>
 /// <en>
 /// Send a array of Char type.
 /// </en>
 /// </summary>
 /// <param name="chars"><ja>‘—M‚·‚镶Žš”z—ñ</ja><en>String array to send</en></param>
 /// <remarks>
 /// <ja>
 /// •¶Žš‚ÍŒ»Ý‚̃Gƒ“ƒR[ƒhÝ’è‚É‚æ‚èƒGƒ“ƒR[ƒh‚³‚ê‚Ä‚©‚ç‘—M‚³‚ê‚Ü‚·B
 /// </ja>
 /// <en>
 /// After it is encoded by a present encode setting, the character is transmitted.
 /// </en>
 /// </remarks>
 public void SendString(char[] chars)
 {
     byte[] data = EncodingProfile.Get(_settings.Encoding).GetBytes(chars);
     Transmit(data);
 }