static void Main()
        {
            ClassThatRaisesEvent eventRaiser = new ClassThatRaisesEvent();
             ClassThatHandlesEvent eventHandler =
            new ClassThatHandlesEvent(eventRaiser);

             eventRaiser.SimulateEvent();
        }
コード例 #2
0
        static void Main()
        {
            ClassThatRaisesEvent  eventRaiser  = new ClassThatRaisesEvent();
            ClassThatHandlesEvent eventHandler =
                new ClassThatHandlesEvent(eventRaiser);

            eventRaiser.SimulateEvent();
        }
 public ClassThatHandlesEvent(ClassThatRaisesEvent eventRaiser)
 {
     eventRaiser.SomeEvent +=
     new CustomEventHandler(HandleEvent);
 }
コード例 #4
0
 public ClassThatHandlesEvent(ClassThatRaisesEvent eventRaiser)
 {
     eventRaiser.SomeEvent +=
         new EventHandler <CustomEventArgs>(HandleEvent);
 }