Beispiel #1
0
 public static T UseQuitCommand <T>(this T kernel, IDisposable disposeOnQuit, CancellationToken cancellationToken)
     where T : Kernel
 {
     Quit.DisposeOnQuit = disposeOnQuit;
     KernelCommandEnvelope.RegisterCommandType <Quit>(nameof(Quit));
     cancellationToken.Register(async() => { await kernel.SendAsync(new Quit()); });
     return(kernel);
 }