Exemple #1
0
 private void OnEventRegistered(object o, EventDescriptionEventArgs e)
 {
     if (e.EventDescription == null || !Setting.Instance.NotificationProperty.IsEnabledNotificationBar) return;
     switch (e.EventDescription.Kind)
     {
         case EventKind.DirectMessage:
             if (!Setting.Instance.NotificationProperty.NotifyDmEvent) return;
             break;
         case EventKind.Favorite:
         case EventKind.Unfavorite:
             if (!Setting.Instance.NotificationProperty.NotifyFavoriteEvent) return;
             break;
         case EventKind.Mention:
             if (!Setting.Instance.NotificationProperty.NotifyMentionEvent) return;
             break;
         case EventKind.Retweet:
             if (!Setting.Instance.NotificationProperty.NotifyRetweetEvent) return;
             break;
         case EventKind.Follow:
             if (!Setting.Instance.NotificationProperty.NotifyFollowEvent) return;
             break;
     }
     var nivm = new NotificationItemViewModel(e.EventDescription);
     nivm.RequireClose += (no, ne) => _notifications.Remove(nivm);
     _notifications.Add(nivm);
     Task.Factory.StartNew(() => Thread.Sleep(Setting.Instance.ExperienceProperty.TwitterActionNotifyShowLength))
         .ContinueWith(_ =>
         {
             try
             {
                 _notifications.Remove(nivm);
             }
             catch { }
         });
 }
Exemple #2
0
        private void OnEventRegistered(object o, EventDescriptionEventArgs e)
        {
            if (e.EventDescription == null || !Setting.Instance.NotificationProperty.IsEnabledNotificationBar)
            {
                return;
            }
            switch (e.EventDescription.Kind)
            {
            case EventKind.DirectMessage:
                if (!Setting.Instance.NotificationProperty.NotifyDmEvent)
                {
                    return;
                }
                break;

            case EventKind.Favorite:
            case EventKind.Unfavorite:
                if (!Setting.Instance.NotificationProperty.NotifyFavoriteEvent)
                {
                    return;
                }
                break;

            case EventKind.Mention:
                if (!Setting.Instance.NotificationProperty.NotifyMentionEvent)
                {
                    return;
                }
                break;

            case EventKind.Retweet:
                if (!Setting.Instance.NotificationProperty.NotifyRetweetEvent)
                {
                    return;
                }
                break;

            case EventKind.Follow:
                if (!Setting.Instance.NotificationProperty.NotifyFollowEvent)
                {
                    return;
                }
                break;
            }
            var nivm = new NotificationItemViewModel(e.EventDescription);

            nivm.RequireClose += (no, ne) => _notifications.Remove(nivm);
            _notifications.Add(nivm);
            Task.Factory.StartNew(() => Thread.Sleep(Setting.Instance.ExperienceProperty.TwitterActionNotifyShowLength))
            .ContinueWith(_ =>
            {
                try
                {
                    _notifications.Remove(nivm);
                }
                catch { }
            });
        }
Exemple #3
0
 public NotifierViewModelEventArgs(NotificationItemViewModel notifier)
 {
     this.NotifierViewModel = notifier;
 }
 public NotifierViewModelEventArgs(NotificationItemViewModel notifier)
 {
     this.NotifierViewModel = notifier;
 }