public event EventHandler ProcessCompletedNew; //Version 2.0 //Beispiel 2 public void StartProcess() { Console.WriteLine("Process Started!"); //Mache etwas!!!! MyEventArg myEventArg = new MyEventArg(); myEventArg.Uhrzeit = DateTime.Now; OnProcessCompleted(EventArgs.Empty); OnProcessCompletedNew(myEventArg); //Beispiel 2 }
private static void Bl2_ProcessCompletedNew(object sender, EventArgs e) { MyEventArg myEventArg = (MyEventArg)e; Console.WriteLine($"Fertig am {myEventArg.Uhrzeit.ToString()}"); }
protected virtual void OnProcessCompletedNew(MyEventArg e) //Beispiel 2 { ProcessCompletedNew?.Invoke(this, e); }