Пример #1
0
        /// <summary>
        ///
        /// </summary>
        private void ProcessController()
        {
            WorldOptions = new List <World>();

            using (pController = new Process())
            {
                pController.EnableRaisingEvents              = true;
                pController.StartInfo.UseShellExecute        = false;
                pController.StartInfo.RedirectStandardError  = true;
                pController.StartInfo.RedirectStandardOutput = true;
                pController.StartInfo.RedirectStandardInput  = true;
                pController.StartInfo.CreateNoWindow         = true;
                pController.StartInfo.FileName         = sFileName;
                pController.StartInfo.WorkingDirectory = sWorkingPath;
                pController.Exited += new System.EventHandler(pController_Exited);
                pController.Start();

                this.IsRunning = true;

                // Create our process manager to handle the input/output to the server application
                ProcMan = new ProcessIoManager(pController);
                ProcMan.StderrTextRead += ProcMan_StderrTextRead;
                ProcMan.StdoutTextRead += ProcMan_StdoutTextRead;

                // Start the individual threads to monitor process text output
                ProcMan.StartProcessOutputRead();

                // Wait for the process to finish
                pController.WaitForExit();
            }
        }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        public Controller()
        {
            bwHelper.WorkerReportsProgress = true;
            bwHelper.DoWork             += new DoWorkEventHandler(bwHelper_DoWork);
            bwHelper.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bwHelper_RunWorkerCompleted);

            ProcMan = null;
        }
Пример #3
0
 /// <summary>
 ///
 /// </summary>
 public void Init()
 {
     ProcMan = null;
 }