コード例 #1
0
ファイル: Program.cs プロジェクト: ulswww/Gapotchenko.FX
        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);
            }
        }
コード例 #2
0
 /// <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));
コード例 #3
0
 /// <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));