public static void Main(string[] args) { using (var cts = new CancellationTokenSource()) { _ = Example_1.DoItAsync(cts.Token); _ = Example_2.Create(DemoHealthCheck.Create(), cts.Token); _ = Example_3.DoItAsync(cts.Token); _ = Example_4.DoItAsync(cts.Token); _ = Example_5.DoItAsync(cts.Token); _ = Example_6.DoItAsync(cts.Token); Console.WriteLine("Press any key to stop."); Console.ReadKey(true); cts.Cancel(); } Console.WriteLine("Press any key to exit."); Console.ReadKey(true); }
public virtual IExampleChoice ChooseAndShow(EExample example) { IExampleChoice choice = null; switch (example) { case EExample.Example_1: choice = new Example_1(); break; case EExample.Example_2: choice = new Example_2(); break; case EExample.Example_3: choice = new Example_3(); break; case EExample.Example_4: choice = new Example_4(); break; case EExample.Example_5: choice = new Example_5(); break; case EExample.Example_6: choice = new Example_6(); break; case EExample.Example_7: choice = new Example_7(); break; case EExample.Quit: default: break; } return(choice); }