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") }
//‚±‚ê‚̓ƒ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)); } }
public void Reset() { //Encoding‚ª“¯‚¶Žž‚ÍŠÈ’P‚ÉÏ‚Ü‚¹‚邱‚Æ‚ª‚Å‚«‚é if (_decoder.CurrentEncoding.Type == GetTerminalSettings().Encoding) { _decoder.Reset(_decoder.CurrentEncoding); } else { _decoder = new ISO2022CharDecoder(this, EncodingProfile.Get(GetTerminalSettings().Encoding)); } }
public void InvalidCharDetected(byte[] buf) { CharDecodeError(String.Format("Message.AbstractTerminal.UnexpectedChar", EncodingProfile.Get(GetTerminalSettings().Encoding).Encoding.WebName)); }
//‰ü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); }