Example #1
0
        private void RunEM3_Exe(string configurationFile)
        {
            _process = new Process();
            EnvironmentInfo.GetEM3ExecutableCallerInfo(_process.StartInfo);
            _process.StartInfo.Arguments += "UI_RUNTOOL_CALL ";
            _process.StartInfo.Arguments += EnvironmentInfo.EncloseByQuotes(_em2ConfigurationFile);

            _process.StartInfo.CreateNoWindow         = true;
            _process.StartInfo.UseShellExecute        = false;
            _process.StartInfo.RedirectStandardOutput = true;
            _process.StartInfo.RedirectStandardError  = true;
            _process.OutputDataReceived += new DataReceivedEventHandler(RunLogHandler);
            _process.ErrorDataReceived  += new DataReceivedEventHandler(ErrorLogHandler);
            if (!_process.Start())
            {
                lock (_errorLogLock) { _errorLog.Add("Failed to start model run."); }
                _runManager.HandleRunExited(this);
            }
            _process.BeginOutputReadLine();
            _process.BeginErrorReadLine();
            _processStatusAdditionalInfo = string.Format("{0:T}", _process.StartTime) + " - ";
            _process.WaitForExit();
        }