예제 #1
0
 public void ShowNotificationMessage(NotificationMessage msg)
 {
     if (mainForm==null || mainForm.IsDisposed) return;
       mainForm.Invoke(new Action(() => {
     if (!mainForm.IsDisposed) {
       mainForm.ShowNotificationMessage(msg);
     }
       }));
 }
예제 #2
0
 public void ShowNotificationMessage(NotificationMessage msg)
 {
   lock (notificationMessages) {
     notificationMessages.Add(msg);
     if (msg is NewVersionNotificationMessage) {
       newVersions = ((NewVersionNotificationMessage)msg).VersionDescriptions;
     }
   }
 }
예제 #3
0
 private void NotifyMessage(NotificationMessage msg)
 {
   lock (messageExpireTimer) {
     if (messageExpireTimer.Elapsed>=MessageExpires) {
       lastMessage = null;
       messageExpireTimer.Reset();
       messageExpireTimer.Start();
     }
     if (lastMessage==null || !lastMessage.Equals(msg)) {
       foreach (var ui in this.app.Plugins.Where(p => p is IUserInterfacePlugin)) {
         ((IUserInterfacePlugin)ui).ShowNotificationMessage(msg);
       }
       lastMessage = msg;
     }
   }
 }
예제 #4
0
 public void ShowNotificationMessage(NotificationMessage message)
 {
   if (notifyIcon==null) return;
   var timeout = 60000;
   var icon = ToolTipIcon.Info;
   switch (message.Type) {
   case NotificationMessageType.Normal:  icon = ToolTipIcon.None; timeout = 30000; break;
   case NotificationMessageType.Info:    icon = ToolTipIcon.Info; break;
   case NotificationMessageType.Warning: icon = ToolTipIcon.Warning; break;
   case NotificationMessageType.Error:   icon = ToolTipIcon.Error; break;
   }
   notifyIcon.ShowBalloonTip(
     timeout,
     message.Title,
     message.Message,
     icon);
 }
예제 #5
0
 public void OnChannelClosed(object sender, StreamStoppedEventArgs args)
 {
   var channel = (Channel)sender;
   switch (args.StopReason) {
   case StopReason.OffAir: {
       var msg = new NotificationMessage(
         channel.ChannelInfo.Name,
         "チャンネルが終了しました",
         NotificationMessageType.Info);
       NotifyMessage(msg);
     }
     break;
   case StopReason.NoHost:
   case StopReason.ConnectionError: {
       var msg = new NotificationMessage(
         channel.ChannelInfo.Name,
         "チャンネルに接続できませんでした",
         NotificationMessageType.Error);
       NotifyMessage(msg);
     }
     break;
   }
 }
예제 #6
0
 public void ShowNotificationMessage(NotificationMessage msg)
 {
     if (notifyIconManager==null) return;
       notifyIconManager.ShowNotificationMessage(msg);
 }
예제 #7
0
 public void ShowNotificationMessage(NotificationMessage msg)
 {
     lock (notificationMessages) {
     notificationMessages.Add(msg);
       }
 }
예제 #8
0
 public virtual void ShowNotificationMessage(NotificationMessage message)
 {
     MessageNotified?.Invoke(this, new NotificationMessageEventArgs(message));
 }
예제 #9
0
 public NotificationMessageEventArgs(NotificationMessage message)
 {
     Message = message;
 }