Exemple #1
0
 public static Task InvokeAllAsync <TEventArgs>(
     this AsyncEventHandler <TEventArgs> handler,
     object sender,
     TEventArgs e)
     where TEventArgs : EventArgs
 => Task.WhenAll(
     handler.GetHandlers()
     .Select(handleAsync => handleAsync(sender, e)));
 public static Task InvokeAllAsync <TEventArgs>(this AsyncEventHandler <TEventArgs> handler, TEventArgs args)
 => Task.WhenAll(handler.GetHandlers().Select(h => h(args)));