Esempio n. 1
0
        public void PushStdinToConsole(Push_Stdio_StdIn data)
        {
            try
            {
                if (consoleproc.HasExited == true)
                {
                    return;
                }
                switch (data.State)
                {
                case PushStdInState.Normal:
                    int written;
                    ConsoleUtilities.WriteConsoleInput(consolestdin, data.data, data.data.Length, out written);
                    break;

                case PushStdInState.CTRL_C:
                    ConsoleUtilities.GenerateConsoleCtrlEvent(ConsoleUtilities.CTRL_C_EVENT, consoleproc.Id);
                    break;

                case PushStdInState.CTRL_BREAK:
                    ConsoleUtilities.GenerateConsoleCtrlEvent(ConsoleUtilities.CTRL_BREAK_EVENT, consoleproc.Id);
                    break;
                }
            }
            catch (Exception ee)
            {
                Debug.WriteLine(ee.ToString());
            }
        }