DroidExplorer.Core.UI.CConsole.ConsoleControl.StartProcess C# (CSharp) Method

StartProcess() public method

Runs a process.
public StartProcess ( string fileName, string arguments ) : void
fileName string Name of the file.
arguments string The arguments.
return void
        public void StartProcess(string fileName, string arguments)
        {
            //  Are we showing diagnostics?
            if(ShowDiagnostics) {
                WriteOutput("Preparing to run " + fileName, Color.FromArgb(255, 0, 255, 0));
                if(!string.IsNullOrEmpty(arguments))
                    WriteOutput(" with arguments " + arguments + "." + Environment.NewLine, Color.FromArgb(255, 0, 255, 0));
                else
                    WriteOutput("." + Environment.NewLine, Color.FromArgb(255, 0, 255, 0));
            }

            //  Start the process.
            processInterace.StartProcess(fileName, arguments);

            //  If we enable input, make the control not read only.
            if(IsInputEnabled) {
                if(InvokeRequired) {
                    Invoke((Action)(() => {
                        richTextBoxConsole.ReadOnly = false;
                    }));
                } else {
                    richTextBoxConsole.ReadOnly = false;
                }
            }
        }