public void StartProcess()
        {
            Console.WriteLine("Process start");
            //Ganz viel Logic


            MyEventArg myEventArg = new MyEventArg();

            myEventArg.Uhrzeit = DateTime.Now;



            OnProcessCompleted(EventArgs.Empty);

            OnProcessCompletedNew(myEventArg); //Beispiel 2
        }
 protected virtual void OnProcessCompletedNew(MyEventArg e)
 {
     ProcessCompletedNew?.Invoke(this, e);
 }
コード例 #3
0
        private static void ProcessBusinessLogic2_ProcessCompletedNew(object sender, EventArgs e)
        {
            MyEventArg myEventArg = (MyEventArg)e;

            Console.WriteLine($"Bin fertig {myEventArg.Uhrzeit.ToString()}");
        }