Esempio n. 1
0
 // This uses 1 of C#'s 2 build-in event handlers:
 // 1. EventHandler(object sender, EventArgs e);
 // 2. EventHandler<TEventArgs>(object sender, TEventArgs e)
 // But you could also build your own.
 // https://docs.microsoft.com/en-us/dotnet/standard/events/how-to-raise-and-consume-events
 public void OnEvent()
 {
     Console.WriteLine("Child's event gets triggert.");
     ChildEvent?.Invoke(
         sender: this,
         e: EventArgs.Empty);
 }
Esempio n. 2
0
 public object InvokeChildEvent()
 {
     return(ChildEvent.Invoke());
 }