예제 #1
0
 public ValidatedChangedPropertyObservation(System.ComponentModel.EventDescriptor validateddEvent, object obj)
 {
     if (validateddEvent.EventType == typeof (EventHandler<EventArgs>))
     {
         validateddEvent.AddEventHandler(obj, (EventHandler<EventArgs>) OnControlValidated);
     }
     else if (validateddEvent.EventType == typeof (EventHandler))
     {
         validateddEvent.AddEventHandler(obj, (EventHandler) OnControlValidated);
     }
 }
 /// <summary>
 /// AddEventHandler
 /// </summary>
 protected override void AddEventHandler(System.Reflection.EventInfo eventInfo, object target, System.Delegate handler) {
     eventInfo.AddEventHandler(target, handler);
 }
예제 #3
0
 public XxxChangedPropertyObservation(System.ComponentModel.EventDescriptor changedEvent, object obj)
 {
     if (changedEvent.EventType == typeof (EventHandler<EventArgs>))
     {
         changedEvent.AddEventHandler(obj, (EventHandler<EventArgs>) OnPropertyValueChanged);
     }
     else if (changedEvent.EventType == typeof (EventHandler))
     {
         changedEvent.AddEventHandler(obj, (EventHandler) OnPropertyValueChanged);
     }
 }