/// <summary> /// Creates a new PipedProcessStartInfo object. /// </summary> /// <param name="filePath">The path to the executable file. Must not be null.</param> /// <param name="baseDirectory">The current searching directory of the executable file.</param> /// <param name="workingDirectory">The initial working directory of the process.</param> /// <param name="arguments">The arguments to supply to the process. Can be null, equivalent to empty collection.</param> /// <param name="redirectedStandardInput">The source of standard input. Can be null (suppress redirection of standard input).</param> /// <param name="redirectedStandardError">The file name of redirected standard error. Default to null (suppress redirection of standard error).</param> /// <param name="append">Indicates whether the standard error will be appended to the file (true) or overwrite the file (false, default).</param> public PipedProcessStartInfo(string filePath, string baseDirectory, string workingDirectory, IEnumerable <string> arguments, ITeedProcessStartInfo redirectedStandardInput, string redirectedStandardError, bool append) { CanInvoke = false; if (filePath == null) { throw new ArgumentNullException("filePath"); } FilePath = filePath; if (baseDirectory == null) { baseDirectory = Directory.GetCurrentDirectory(); } BaseDirectory = baseDirectory; if (workingDirectory == null) { workingDirectory = baseDirectory; } WorkingDirectory = workingDirectory; this.arguments = new List <string>(); if (arguments != null) { this.arguments.AddRange(arguments); } RedirectedStandardInput = redirectedStandardInput; RedirectedStandardError = redirectedStandardError; standardErrorAppend = append; CanInvoke = true; }
/// <summary> /// Creates a new PipedProcessStartInfo object. /// </summary> /// <param name="filePath">The path to the executable file. Must not be null.</param> /// <param name="baseDirectory">The current searching directory of the executable file.</param> /// <param name="workingDirectory">The initial working directory of the process.</param> /// <param name="arguments">The arguments to supply to the process. Can be null, equivalent to empty collection.</param> /// <param name="redirectedStandardInput">The source of standard input. Can be null (suppress redirection of standard input).</param> public PipedProcessStartInfo(string filePath, string baseDirectory, string workingDirectory, IEnumerable <string> arguments, ITeedProcessStartInfo redirectedStandardInput) : this(filePath, baseDirectory, workingDirectory, arguments, redirectedStandardInput, null, false) { }