Ejemplo n.º 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 { }
         });
 }
Ejemplo n.º 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 { }
            });
        }
Ejemplo n.º 3
0
 public NotifierViewModelEventArgs(NotificationItemViewModel notifier)
 {
     this.NotifierViewModel = notifier;
 }
Ejemplo n.º 4
0
 public NotifierViewModelEventArgs(NotificationItemViewModel notifier)
 {
     this.NotifierViewModel = notifier;
 }