예제 #1
0
        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()}");
        }
예제 #3
0
 protected virtual void OnProcessCompletedNew(MyEventArg e) //Beispiel 2
 {
     ProcessCompletedNew?.Invoke(this, e);
 }