示例#1
0
        public static Terminal Create(PipeFactory pipeFactory)
        {
            if (pipeFactory == null)
            {
                throw new ArgumentNullException(nameof(pipeFactory));
            }

            var terminal = new Terminal
            {
                Out = pipeFactory.CreateServer(),
                In  = pipeFactory.CreateServer()
            };

            terminal.Process = new Process
            {
                StartInfo = new ProcessStartInfo("WinTerMul.Terminal.exe")
                {
                    Arguments   = $"{terminal.Out.Id} {terminal.In.Id} {Process.GetCurrentProcess().Id}",
                    WindowStyle = ProcessWindowStyle.Hidden
                }
            };
            terminal.Process.Start();

            return(terminal);
        }