コード例 #1
0
ファイル: Notification.cs プロジェクト: Booser/radegast
 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
ファイル: Notification.cs プロジェクト: Booser/radegast
 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);
     }
 }