예제 #1
0
 public void HookNotification(Notification notification)
 {
     Notice = notification;
     int hooked = 0;
     lock (notification)
     {
         notification.HandleDestroyed += Notification_Closing;
         lock (Buttons)
             foreach (var button in Buttons)
             {
                 button.Click += Notification_Click;
                 hooked++;
             }
     }
     if (hooked == 0)
         throw new InvalidOperationException("No buttons found on Dialog " + Text);
 }
예제 #2
0
 private void Notificaton_Displayed(Notification notification, NotificationEventArgs e)
 {
     try
     {
         e.HookNotification(this);
         if (OnNotificationDisplayed != null)
             OnNotificationDisplayed(notification, e);
     }
     catch (Exception ex)
     {
         Console.WriteLine("" + ex);
         OpenMetaverse.Logger.Log("Error executing notification displayed", OpenMetaverse.Helpers.LogLevel.Warning, ex);
     }
 }