Ejemplo n.º 1
0
 private void AttachNotifications()
 {
     foreach (MBeanInternalNotificationInfo notifInfo in _internalInfo.Notifications)
     {
         if (typeof(Notification).IsAssignableFrom(notifInfo.HandlerGenericArgument))
         {
             Delegate del = Delegate.CreateDelegate(notifInfo.HandlerType, this, "HandleNotification");
             notifInfo.EventInfo.AddEventHandler(_impl, del);
         }
         else if (typeof(NotificationEventArgs).IsAssignableFrom(notifInfo.HandlerGenericArgument))
         {
             SimpleNotificationHandler handler = new SimpleNotificationHandler(_notificationSupport,
                                                                               notifInfo.NotificationInfo.
                                                                               NotifTypes[0]);
             Delegate del = Delegate.CreateDelegate(notifInfo.HandlerType, handler, "HandleSimpleNotification");
             notifInfo.EventInfo.AddEventHandler(_impl, del);
         }
     }
 }
Ejemplo n.º 2
0
 private void AttachNotifications()
 {
     foreach (MBeanInternalNotificationInfo notifInfo in _internalInfo.Notifications)
      {
     if (typeof (Notification).IsAssignableFrom(notifInfo.HandlerGenericArgument))
     {
        Delegate del = Delegate.CreateDelegate(notifInfo.HandlerType, this, "HandleNotification");
        notifInfo.EventInfo.AddEventHandler(_impl, del);
     }
     else if (typeof (NotificationEventArgs).IsAssignableFrom(notifInfo.HandlerGenericArgument))
     {
        SimpleNotificationHandler handler = new SimpleNotificationHandler(_notificationSupport,
                                                                          notifInfo.NotificationInfo.
                                                                             NotifTypes[0]);
        Delegate del = Delegate.CreateDelegate(notifInfo.HandlerType, handler, "HandleSimpleNotification");
        notifInfo.EventInfo.AddEventHandler(_impl, del);
     }
      }
 }