static void Main(string[] args) { try { _Run(); TaskBridge.Execute(_RunAsync); Console.WriteLine(); Console.WriteLine("----------------------"); Console.WriteLine("DONE"); } catch (Exception e) { Console.Write("Error: "); Console.WriteLine(e); } }
/// <summary> /// Instructs the <see cref="Process"/> component to wait the specified number of milliseconds for the associated process to exit. /// </summary> /// <param name="process">The process.</param> /// <param name="milliseconds">The amount of time, in milliseconds, to wait for the associated process to exit.</param> /// <param name="cancellationToken">The cancellation token.</param> public static void WaitForExit(this Process process, int milliseconds, CancellationToken cancellationToken) => TaskBridge.Execute(WaitForExitAsync(process, milliseconds, cancellationToken));
/// <summary> /// Ends a process according to a specified mode and timeout. /// </summary> /// <param name="process">The process to end.</param> /// <param name="mode">The mode of ending a process.</param> /// <param name="millisecondsTimeout">The amount of time, in milliseconds, to wait for the associated process to end.</param> /// <returns>The mode in which the process has been ended.</returns> public static ProcessEndMode End(this Process process, ProcessEndMode mode, int millisecondsTimeout) => TaskBridge.Execute(ct => EndAsync(process, mode, millisecondsTimeout, ct));