Exemplo n.º 1
0
 public void Start()
 {
     if (server == null)
     {
         server = new PipeServer();
         server.OnMessage.Subscribe(OnMessageArrived);
         server.Start();
     }
 }
Exemplo n.º 2
0
        // Handle Exited event and display process information.
        private void myProcess_Exited(object sender, System.EventArgs e)
        {
            Console.WriteLine(
                $"Exit time    : {pipeClient.ExitTime}\n" +
                $"Exit code    : {pipeClient.ExitCode}\n" +
                $"Elapsed time : {Math.Round((pipeClient.ExitTime - pipeClient.StartTime).TotalMilliseconds)}");
            eventHandled.TrySetResult(true);

            Console.WriteLine("Deberia abrir otro window");
            PipeServer pipeServer = new PipeServer();

            pipeServer.StartProcess();
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            System.Threading.CancellationTokenSource cancellationTokenSource = new System.Threading.CancellationTokenSource();

            Task t = new Task(() => {
                PipeServer pipeServer = new PipeServer();
                pipeServer.start(cancellationTokenSource.Token);
                pipeServer = null;
            });

            t.Start();

            Console.CancelKeyPress += delegate(object sender, ConsoleCancelEventArgs e) {
                e.Cancel            = true;
                Program.keepRunning = false;
            };

            while (Program.keepRunning)
            {
                // Do your work in here, in small chunks.
                // If you literally just want to wait until ctrl-c,
                // not doing anything, see the answer using set-reset events.
            }
        }
Exemplo n.º 4
0
        static void Main()
        {
            PipeServer pipeServer = new PipeServer();

            pipeServer.StartProcess();
        }