Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -193,31 +193,31 @@ public void Refresh() { }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")]
[System.Runtime.Versioning.SupportedOSPlatformAttribute("maccatalyst")]
public static System.Diagnostics.ProcessExitStatus Run(string fileName, System.Collections.Generic.IList<string>? arguments = null, bool silent = false, System.TimeSpan? timeout = default(System.TimeSpan?)) { throw null; }
public static System.Diagnostics.ProcessExitStatus Run(string fileName, System.Collections.Generic.IEnumerable<string>? arguments = null, bool silent = false, System.TimeSpan? timeout = default(System.TimeSpan?)) { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")]
[System.Runtime.Versioning.SupportedOSPlatformAttribute("maccatalyst")]
public static System.Diagnostics.ProcessTextOutput RunAndCaptureText(System.Diagnostics.ProcessStartInfo startInfo, System.TimeSpan? timeout = default(System.TimeSpan?)) { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")]
[System.Runtime.Versioning.SupportedOSPlatformAttribute("maccatalyst")]
public static System.Diagnostics.ProcessTextOutput RunAndCaptureText(string fileName, System.Collections.Generic.IList<string>? arguments = null, System.TimeSpan? timeout = default(System.TimeSpan?)) { throw null; }
public static System.Diagnostics.ProcessTextOutput RunAndCaptureText(string fileName, System.Collections.Generic.IEnumerable<string>? arguments = null, System.TimeSpan? timeout = default(System.TimeSpan?)) { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")]
[System.Runtime.Versioning.SupportedOSPlatformAttribute("maccatalyst")]
public static System.Threading.Tasks.Task<System.Diagnostics.ProcessTextOutput> RunAndCaptureTextAsync(System.Diagnostics.ProcessStartInfo startInfo, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")]
[System.Runtime.Versioning.SupportedOSPlatformAttribute("maccatalyst")]
public static System.Threading.Tasks.Task<System.Diagnostics.ProcessTextOutput> RunAndCaptureTextAsync(string fileName, System.Collections.Generic.IList<string>? arguments = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static System.Threading.Tasks.Task<System.Diagnostics.ProcessTextOutput> RunAndCaptureTextAsync(string fileName, System.Collections.Generic.IEnumerable<string>? arguments = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")]
[System.Runtime.Versioning.SupportedOSPlatformAttribute("maccatalyst")]
public static System.Threading.Tasks.Task<System.Diagnostics.ProcessExitStatus> RunAsync(System.Diagnostics.ProcessStartInfo startInfo, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")]
[System.Runtime.Versioning.SupportedOSPlatformAttribute("maccatalyst")]
public static System.Threading.Tasks.Task<System.Diagnostics.ProcessExitStatus> RunAsync(string fileName, System.Collections.Generic.IList<string>? arguments = null, bool silent = false, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static System.Threading.Tasks.Task<System.Diagnostics.ProcessExitStatus> RunAsync(string fileName, System.Collections.Generic.IEnumerable<string>? arguments = null, bool silent = false, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")]
[System.Runtime.Versioning.SupportedOSPlatformAttribute("maccatalyst")] // this needs to come after the ios attribute due to limitations in the platform analyzer
Expand Down Expand Up @@ -251,7 +251,7 @@ public void Refresh() { }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")]
[System.Runtime.Versioning.SupportedOSPlatformAttribute("maccatalyst")] // this needs to come after the ios attribute due to limitations in the platform analyzer
public static int StartAndForget(string fileName, System.Collections.Generic.IList<string>? arguments = null) { throw null; }
public static int StartAndForget(string fileName, System.Collections.Generic.IEnumerable<string>? arguments = null) { throw null; }
public override string ToString() { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static int StartAndForget(ProcessStartInfo startInfo)
/// </summary>
/// <param name="fileName">The name of the application or document to start.</param>
/// <param name="arguments">
/// The command-line arguments to pass to the process. Pass <see langword="null"/> or an empty list
/// The command-line arguments to pass to the process. Pass <see langword="null"/> or an empty sequence
/// to start the process without additional arguments.
/// </param>
/// <returns>The process ID of the started process.</returns>
Expand All @@ -80,7 +80,7 @@ public static int StartAndForget(ProcessStartInfo startInfo)
[UnsupportedOSPlatform("ios")]
[UnsupportedOSPlatform("tvos")]
[SupportedOSPlatform("maccatalyst")]
public static int StartAndForget(string fileName, IList<string>? arguments = null)
public static int StartAndForget(string fileName, IEnumerable<string>? arguments = null)
Comment thread
adamsitnik marked this conversation as resolved.
=> StartAndForget(CreateStartInfo(fileName, arguments));

/// <summary>
Expand Down Expand Up @@ -118,7 +118,7 @@ public static ProcessExitStatus Run(ProcessStartInfo startInfo, TimeSpan? timeou
/// </summary>
/// <param name="fileName">The name of the application or document to start.</param>
/// <param name="arguments">
/// The command-line arguments to pass to the process. Pass <see langword="null"/> or an empty list
/// The command-line arguments to pass to the process. Pass <see langword="null"/> or an empty sequence
/// to start the process without additional arguments.
/// </param>
/// <param name="silent">
Expand All @@ -137,7 +137,7 @@ public static ProcessExitStatus Run(ProcessStartInfo startInfo, TimeSpan? timeou
[UnsupportedOSPlatform("ios")]
[UnsupportedOSPlatform("tvos")]
[SupportedOSPlatform("maccatalyst")]
public static ProcessExitStatus Run(string fileName, IList<string>? arguments = null, bool silent = false, TimeSpan? timeout = default)
public static ProcessExitStatus Run(string fileName, IEnumerable<string>? arguments = null, bool silent = false, TimeSpan? timeout = default)
Comment thread
adamsitnik marked this conversation as resolved.
{
ProcessStartInfo startInfo = CreateStartInfo(fileName, arguments);

Expand Down Expand Up @@ -181,7 +181,7 @@ public static async Task<ProcessExitStatus> RunAsync(ProcessStartInfo startInfo,
/// </summary>
/// <param name="fileName">The name of the application or document to start.</param>
/// <param name="arguments">
/// The command-line arguments to pass to the process. Pass <see langword="null"/> or an empty list
/// The command-line arguments to pass to the process. Pass <see langword="null"/> or an empty sequence
/// to start the process without additional arguments.
/// </param>
/// <param name="silent">
Expand All @@ -199,7 +199,7 @@ public static async Task<ProcessExitStatus> RunAsync(ProcessStartInfo startInfo,
[UnsupportedOSPlatform("ios")]
[UnsupportedOSPlatform("tvos")]
[SupportedOSPlatform("maccatalyst")]
public static async Task<ProcessExitStatus> RunAsync(string fileName, IList<string>? arguments = null, bool silent = false, CancellationToken cancellationToken = default)
public static async Task<ProcessExitStatus> RunAsync(string fileName, IEnumerable<string>? arguments = null, bool silent = false, CancellationToken cancellationToken = default)
Comment thread
adamsitnik marked this conversation as resolved.
{
ProcessStartInfo startInfo = CreateStartInfo(fileName, arguments);

Expand Down Expand Up @@ -275,7 +275,7 @@ public static ProcessTextOutput RunAndCaptureText(ProcessStartInfo startInfo, Ti
/// </summary>
/// <param name="fileName">The name of the application or document to start.</param>
/// <param name="arguments">
/// The command-line arguments to pass to the process. Pass <see langword="null"/> or an empty list
/// The command-line arguments to pass to the process. Pass <see langword="null"/> or an empty sequence
/// to start the process without additional arguments.
/// </param>
/// <param name="timeout">
Expand All @@ -289,7 +289,7 @@ public static ProcessTextOutput RunAndCaptureText(ProcessStartInfo startInfo, Ti
[UnsupportedOSPlatform("ios")]
[UnsupportedOSPlatform("tvos")]
[SupportedOSPlatform("maccatalyst")]
public static ProcessTextOutput RunAndCaptureText(string fileName, IList<string>? arguments = null, TimeSpan? timeout = default)
public static ProcessTextOutput RunAndCaptureText(string fileName, IEnumerable<string>? arguments = null, TimeSpan? timeout = default)
Comment thread
adamsitnik marked this conversation as resolved.
=> RunAndCaptureText(CreateStartInfoForCapture(fileName, arguments), timeout);

/// <summary>
Expand Down Expand Up @@ -342,7 +342,7 @@ public static async Task<ProcessTextOutput> RunAndCaptureTextAsync(ProcessStartI
/// </summary>
/// <param name="fileName">The name of the application or document to start.</param>
/// <param name="arguments">
/// The command-line arguments to pass to the process. Pass <see langword="null"/> or an empty list
/// The command-line arguments to pass to the process. Pass <see langword="null"/> or an empty sequence
/// to start the process without additional arguments.
/// </param>
/// <param name="cancellationToken">
Expand All @@ -355,26 +355,17 @@ public static async Task<ProcessTextOutput> RunAndCaptureTextAsync(ProcessStartI
[UnsupportedOSPlatform("ios")]
[UnsupportedOSPlatform("tvos")]
[SupportedOSPlatform("maccatalyst")]
public static Task<ProcessTextOutput> RunAndCaptureTextAsync(string fileName, IList<string>? arguments = null, CancellationToken cancellationToken = default)
public static Task<ProcessTextOutput> RunAndCaptureTextAsync(string fileName, IEnumerable<string>? arguments = null, CancellationToken cancellationToken = default)
Comment thread
adamsitnik marked this conversation as resolved.
=> RunAndCaptureTextAsync(CreateStartInfoForCapture(fileName, arguments), cancellationToken);

private static ProcessStartInfo CreateStartInfo(string fileName, IList<string>? arguments)
private static ProcessStartInfo CreateStartInfo(string fileName, IEnumerable<string>? arguments)
Comment thread
adamsitnik marked this conversation as resolved.
{
ArgumentException.ThrowIfNullOrEmpty(fileName);

ProcessStartInfo startInfo = new(fileName);
if (arguments is not null)
{
foreach (string argument in arguments)
{
startInfo.ArgumentList.Add(argument);
}
}

return startInfo;
return arguments is not null ? new ProcessStartInfo(fileName, arguments) : new ProcessStartInfo(fileName);
}

private static ProcessStartInfo CreateStartInfoForCapture(string fileName, IList<string>? arguments)
private static ProcessStartInfo CreateStartInfoForCapture(string fileName, IEnumerable<string>? arguments)
{
ProcessStartInfo startInfo = CreateStartInfo(fileName, arguments);
startInfo.RedirectStandardOutput = true;
Expand Down
Loading