Exemplo n.º 1
0
        public static RMProcess Start(ProcessStartInfo startInfo)
        {
            if (startInfo == null)
            {
                throw new ArgumentNullException("startInfo");
            }
            startInfo.UseShellExecute = false;
            RMProcess process = new RMProcess();

            process.StartInfo = startInfo;
            if (process.Start())
            {
                return(process);
            }
            return(null);
        }
Exemplo n.º 2
0
        public void StartAndWait(ProcessStartInfo startInfo)
        {
            // And start the process and wait for it to quit
            using (RMProcess P = RMProcess.Start(startInfo))
            {
                RaiseStartEvent();

                bool Stop = false;
                while ((!Stop) && (!P.HasExited))
                {
                    P.WaitForExit(100);
                    Stop = RaiseWaitEvent();
                }

                if (!P.HasExited)
                {
                    P.Kill();
                }
            }
        }