Exemplo n.º 1
0
        public static ITerminalSession InvokeOpenSessionOrNull(ICommandTarget target, TerminalParam param)
        {
            ITerminalParameter tp = param.ConvertToTerminalParameter();
            ITerminalSettings ts = CreateTerminalSettings(param);

            IViewManager pm = CommandTargetUtil.AsWindow(target).ViewManager;
            //独立ウィンドウにポップアップさせるようなことは考えていない
            IContentReplaceableView rv = (IContentReplaceableView)pm.GetCandidateViewForNewDocument().GetAdapter(typeof(IContentReplaceableView));
            TerminalControl tc = (TerminalControl)rv.GetCurrentContent().GetAdapter(typeof(TerminalControl));
            if (tc != null) { //ターミナルコントロールがないときは無理に設定しにいかない
                RenderProfile rp = ts.UsingDefaultRenderProfile ? MacroPlugin.Instance.TerminalEmulatorService.TerminalEmulatorOptions.CreateRenderProfile() : ts.RenderProfile;
                Size sz = tc.CalcTerminalSize(rp);
                tp.SetTerminalSize(sz.Width, sz.Height);
            }

            return (ITerminalSession)MacroPlugin.Instance.WindowManager.ActiveWindow.AsForm().Invoke(new OpenSessionDelegate(OpenSessionOrNull), tp, ts);
        }
Exemplo n.º 2
0
        public static ITerminalSession InvokeOpenSessionOrNull(ICommandTarget target, TerminalParam param)
        {
            ITerminalParameter tp = param.ConvertToTerminalParameter();
            ITerminalSettings ts = CreateTerminalSettings(param);

            IViewManager pm = CommandTargetUtil.AsWindow(target).ViewManager;
            //�Ɨ��E�B���h�E�Ƀ|�b�v�A�b�v������悤�Ȃ��Ƃ͍l���Ă��Ȃ�
            IContentReplaceableView rv = (IContentReplaceableView)pm.GetCandidateViewForNewDocument().GetAdapter(typeof(IContentReplaceableView));
            TerminalControl tc = (TerminalControl)rv.GetCurrentContent().GetAdapter(typeof(TerminalControl));
            if (tc != null) { //�^�[�~�i���R���g���[�����Ȃ��Ƃ��͖����ɐݒ肵�ɂ����Ȃ�
                RenderProfile rp = ts.UsingDefaultRenderProfile ? MacroPlugin.Instance.TerminalEmulatorService.TerminalEmulatorOptions.CreateRenderProfile() : ts.RenderProfile;
                Size sz = tc.CalcTerminalSize(rp);
                tp.SetTerminalSize(sz.Width, sz.Height);
            }

            return (ITerminalSession)MacroPlugin.Instance.WindowManager.ActiveWindow.AsForm().Invoke(new OpenSessionDelegate(OpenSessionOrNull), tp, ts);
        }