Ejemplo n.º 1
0
        public Eventsclass()
        {
            var        myEvent    = new MyEvent();
            MyListener myListener = new MyListener(myEvent);

            myEvent.Raise();

            Console.WriteLine("          Set myListener to null");
            myListener = null;
            CallGarbageCollector();

            myEvent.Raise();

            Console.WriteLine("          Set myEvent to null");
            myEvent = null;

            CallGarbageCollector();
        }
Ejemplo n.º 2
0
 // ReSharper disable once ReturnValueOfPureMethodIsNotUsed
 public void RaiseEvent(EventArgs args) => MyEvent.Raise(this, args);
 private void DoSomething()
 {
     MyEvent.Raise(this, EventArgs.Empty);
 }
Ejemplo n.º 4
0
 public void DoSomething()
 {
     MyEvent.Raise(this, EventArgs.Empty);
 }