public CustomButton_Process(Process_type process_type, string command, string command_args = "") { process = new Process(); process.StartInfo.FileName = command; process.StartInfo.Arguments = command_args; this.process_type = process_type; if (process_type == Process_type.Normal) { process.StartInfo.CreateNoWindow = false; process.StartInfo.UseShellExecute = true; } else if (process_type == Process_type.Admin) { process.StartInfo.CreateNoWindow = false; process.StartInfo.UseShellExecute = true; process.StartInfo.Verb = "runas"; } else if (process_type == Process_type.Silent) { process.StartInfo.CreateNoWindow = true; process.StartInfo.UseShellExecute = false; } }
private string parse_Run(CustomButton customButton, string input_text, Process_type process_type) { CustomButton_Process customButton_Process; string[] a = input_text.Split(new[] { ' ' }, 2, StringSplitOptions.RemoveEmptyEntries); if (a.Length == 0) { return("Performer [" + customButton.Text + "] — Syntax error in " + customButton.action_type.ToString() + " command"); } else if (a.Length == 1) { customButton_Process = new CustomButton_Process(process_type, a[0]); } else { customButton_Process = new CustomButton_Process(process_type, a[0], a[1]); } customButton.actions.Add(customButton_Process); return(""); }