Exemple #1
0
        public override void EndCommand(List <GLine> command_result)
        {
            CommandResultDocument doc = new CommandResultDocument(_executingCommand);

            foreach (GLine line in command_result)
            {
                doc.AddLine(line.Clone());
            }

            TerminalControl tc = _terminal.TerminalHost.TerminalControl;

            if (tc == null)
            {
                return;
            }

            Debug.Assert(tc.InvokeRequired);

            IAsyncResult ar = tc.BeginInvoke(CommandResultSession.Start, _terminal, doc);

            AsyncResultQuickHack(tc, ar);
        }
Exemple #2
0
        private static void SessionEntryPoint(AbstractTerminal terminal, CommandResultDocument document)
        {
            try {
                TerminalControl tc = terminal.TerminalHost.TerminalControl;
                Debug.Assert(tc != null);
                RenderProfile          rp          = (RenderProfile)tc.GetRenderProfile().Clone();
                CommandResultSession   session     = new CommandResultSession(document, rp); //現在のRenderProfileを使ってセッションを作る
                TerminalDocument       terminaldoc = terminal.GetDocument();
                PopupViewCreationParam cp          = new PopupViewCreationParam(_viewFactory);
                //結果のサイズに合わせる。ただし高さは20行を上限とする
                cp.InitialSize = new Size(tc.ClientSize.Width, (int)(RuntimeUtil.AdjustIntRange(document.Size, 0, 20) * rp.Pitch.Height) + 2);
                cp.OwnedByCommandTargetWindow = GEnv.Options.CommandPopupAlwaysOnTop;
                cp.ShowInTaskBar = GEnv.Options.CommandPopupInTaskBar;

                IWindowManager       wm     = TerminalEmulatorPlugin.Instance.GetWindowManager();
                ISessionManager      sm     = TerminalEmulatorPlugin.Instance.GetSessionManager();
                IPoderosaPopupWindow window = wm.CreatePopupView(cp);
                sm.StartNewSession(session, window.InternalView);
                sm.ActivateDocument(session.Document, ActivateReason.InternalAction);
            }
            catch (Exception ex) {
                RuntimeUtil.ReportException(ex);
            }
        }
 public CommandResultSession(CommandResultDocument doc, RenderProfile prof) {
     _document = doc;
     _renderProfile = prof;
 }
        private static void SessionEntryPoint(AbstractTerminal terminal, CommandResultDocument document) {
            try {
                TerminalControl tc = terminal.TerminalHost.TerminalControl;
                Debug.Assert(tc != null);
                RenderProfile rp = (RenderProfile)tc.GetRenderProfile().Clone();
                CommandResultSession session = new CommandResultSession(document, rp); //現在のRenderProfileを使ってセッションを作る
                TerminalDocument terminaldoc = terminal.GetDocument();
                PopupViewCreationParam cp = new PopupViewCreationParam(_viewFactory);
                //結果のサイズに合わせる。ただし高さは20行を上限とする
                cp.InitialSize = new Size(tc.ClientSize.Width, (int)(RuntimeUtil.AdjustIntRange(document.Size, 0, 20) * rp.Pitch.Height) + 2);
                cp.OwnedByCommandTargetWindow = GEnv.Options.CommandPopupAlwaysOnTop;
                cp.ShowInTaskBar = GEnv.Options.CommandPopupInTaskBar;

                IWindowManager wm = TerminalEmulatorPlugin.Instance.GetWindowManager();
                ISessionManager sm = TerminalEmulatorPlugin.Instance.GetSessionManager();
                IPoderosaPopupWindow window = wm.CreatePopupView(cp);
                sm.StartNewSession(session, window.InternalView);
                sm.ActivateDocument(session.Document, ActivateReason.InternalAction);
            }
            catch (Exception ex) {
                RuntimeUtil.ReportException(ex);
            }
        }
Exemple #5
0
 public CommandResultSession(CommandResultDocument doc, RenderProfile prof)
 {
     _document      = doc;
     _renderProfile = prof;
 }
        public override void EndCommand(List<GLine> command_result)
        {
            CommandResultDocument doc = new CommandResultDocument(_executingCommand);
            foreach (GLine line in command_result)
                doc.AddLine(line.Clone());

            TerminalControl tc = _terminal.TerminalHost.TerminalControl;
            if (tc == null)
                return;

            Debug.Assert(tc.InvokeRequired);

            IAsyncResult ar = tc.BeginInvoke(CommandResultSession.Start, _terminal, doc);
            AsyncResultQuickHack(tc, ar);
        }