示例#1
0
        /// <summary>
        /// Запустить внешний процесс, используя procInterface
        /// </summary>
        /// <param name="procInterface"></param>
        /// <param name="AppName"></param>
        /// <param name="Switch"></param>
        /// <param name="args"></param>
        /// <param name="TaskName"></param>
        /// <returns></returns>
        private bool ExecuteProcess(ProcessInterface.ProcessInterface procInterface, string AppName, string args, string TaskName)
        {
            isBusy = true;
            ProcessStartInfo psi         = CreateProcessStartInfo(AppName, args);
            string           erroroutput = string.Empty;

            // Start process
            bool res = procInterface.StartProcess(psi);

            procInterface.WaitForExitProcess();

            try
            {
                erroroutput = ErrorStringBuilder.ToString();

                if (erroroutput.Length > 0)
                {
                    res = false;
                    ParseErrorString(erroroutput);
                }
            }
            catch (Exception ex)
            {
                Schematix.Core.Logger.Log.Error("Execute process error.", ex);
                System.Windows.MessageBox.Show(string.Format("Execute process error. Message: {0}", ex.Message), "Error ocrred", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Error);
                isBusy = false;
            }
            isBusy = false;

            return(res);
        }
示例#2
0
 private static void WatchErrorStream()
 {
     while (!ThatProgramProcess.StandardError.EndOfStream)
     {
         ErrorStringBuilder.AppendLine(ThatProgramProcess.StandardError.ReadLine());
     }
 }
示例#3
0
 /// <summary>
 /// Запуск процесса GHDL со специфическими аргументами
 /// </summary>
 /// <param name="AppName"></param>
 /// <param name="Switch"></param>
 /// <param name="args"></param>
 /// <param name="TaskName"></param>
 private bool CreateExecuteProcess(string AppName, string args, string TaskName)
 {
     ErrorStringBuilder.Clear();
     if (ProcessInterface != null)
     {
         return(ExecuteProcess(ProcessInterface, AppName, args, TaskName));
     }
     else
     {
         return(ExecuteProcess(AppName, args, TaskName));
     }
 }