static void Main() { ClassThatRaisesEvent eventRaiser = new ClassThatRaisesEvent(); ClassThatHandlesEvent eventHandler = new ClassThatHandlesEvent(eventRaiser); eventRaiser.SimulateEvent(); }
public ClassThatHandlesEvent(ClassThatRaisesEvent eventRaiser) { eventRaiser.SomeEvent += new CustomEventHandler(HandleEvent); }
public ClassThatHandlesEvent(ClassThatRaisesEvent eventRaiser) { eventRaiser.SomeEvent += new EventHandler <CustomEventArgs>(HandleEvent); }