Esempio n. 1
0
 public void ApplyTerminalOptions(ITerminalEmulatorOptions opt)
 {
     if (this.EnabledEx)
     {
         if (GetTerminalSettings().UsingDefaultRenderProfile)
         {
             using (RenderProfile profile = opt.CreateRenderProfile())
                 ApplyRenderProfile(profile);
         }
         _caret.Style = opt.CaretType;
         _caret.Blink = opt.CaretBlink;
         _caret.Color = opt.CaretColor;
         _caret.Reset();
     }
 }
Esempio n. 2
0
        //必ずimportされるという前提なのでちょっと危険
        public void OnPreferenceImport(IPreferenceFolder oldvalues, IPreferenceFolder newvalues)
        {
            ITerminalEmulatorOptions opt = (ITerminalEmulatorOptions)newvalues.QueryAdapter(typeof(ITerminalEmulatorOptions));

            //DefaultRenderProfile
            GEnv.DefaultRenderProfile = opt.CreateRenderProfile();

            //必要なTerminalSessionにApplyTerminalOptions
            ISessionManager sm = TerminalEmulatorPlugin.Instance.GetSessionManager();

            foreach (ISession session in sm.AllSessions)
            {
                IAbstractTerminalHost ts = (IAbstractTerminalHost)session.GetAdapter(typeof(IAbstractTerminalHost));
                if (ts != null)
                {
                    TerminalControl tc = ts.TerminalControl;
                    if (tc != null)
                    {
                        tc.ApplyTerminalOptions(opt);
                    }
                }
            }

            //ASCIIWordBreakTable
            ASCIIWordBreakTable table = ASCIIWordBreakTable.Default;

            table.Reset();
            foreach (char ch in opt.AdditionalWordElement)
            {
                table.Set(ch, ASCIIWordBreakTable.LETTER);
            }

            //キーバインド系をリセット
            TerminalEmulatorPlugin.Instance.CustomKeySettings.Reset(opt);

            //KeepAliveのリフレッシュ
            TerminalEmulatorPlugin.Instance.KeepAlive.Refresh(opt.KeepAliveInterval);

            _originalOptions.ResetParseKeyFlag();
        }
 public void ApplyTerminalOptions(ITerminalEmulatorOptions opt)
 {
     if (this.EnabledEx) {
         if (GetTerminalSettings().UsingDefaultRenderProfile) {
             ApplyRenderProfile(opt.CreateRenderProfile());
         }
         _caret.Style = opt.CaretType;
         _caret.Blink = opt.CaretBlink;
         _caret.Color = opt.CaretColor;
         _caret.Reset();
     }
 }