예제 #1
0
        public override void EndCommand(List <GLine> command_result)
        {
            StringBuilder bld = new StringBuilder();

            foreach (GLine line in command_result)
            {
                line.WriteTo(
                    delegate(char[] buff, int len) {
                    bld.Append(buff, 0, len);
                });
                if (line.EOLType != EOLType.Continue)
                {
                    bld.Append("\r\n");
                }
            }

            if (bld.Length > 0)
            {
                //コピーはメインスレッドでやらんと
                TerminalControl tc = _terminal.TerminalHost.TerminalControl;
                if (tc == null)
                {
                    return;
                }

                Debug.Assert(tc.InvokeRequired);
                IAsyncResult ar = tc.BeginInvoke(new CopyToClipboardDelegate(CopyToClipboard), bld.ToString());
                AsyncResultQuickHack(tc, ar);
            }
        }
예제 #2
0
        public override void EndCommand(List <GLine> command_result)
        {
            StringBuilder bld = new StringBuilder();

            foreach (GLine line in command_result)
            {
                char[] text = line.Text;
                for (int i = 0; i < text.Length; i++)
                {
                    char ch = text[i];
                    if (ch == '\0')
                    {
                        break;
                    }
                    if (ch != GLine.WIDECHAR_PAD)
                    {
                        bld.Append(ch);
                    }
                }

                if (line.EOLType != EOLType.Continue)
                {
                    bld.Append("\r\n");
                }
            }

            if (bld.Length > 0)
            {
                //コピーはメインスレッドでやらんと
                TerminalControl tc = _terminal.TerminalHost.TerminalControl;
                if (tc == null)
                {
                    return;
                }

                Debug.Assert(tc.InvokeRequired);
                IAsyncResult ar = tc.BeginInvoke(new CopyToClipboardDelegate(CopyToClipboard), bld.ToString());
                AsyncResultQuickHack(tc, ar);
            }
        }
예제 #3
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);
        }