コード例 #1
0
 /// <summary>
 /// Add a Notification to the List.
 /// </summary>
 public void AddNotification(string p_ServerTime, string p_Notify_id, string p_Time, string p_Type, string p_Subject)
 {
     if (Notifications.All(notification => notification.Notify_ID != p_Notify_id))
     {
         Notifications.Add(new Notification(p_ServerTime, p_Notify_id, p_Time, p_Type, p_Subject));
     }
     else
     {
         return;
     }
 }
コード例 #2
0
ファイル: Artist.cs プロジェクト: yngvebn/ArtistBasePage
 public void AddNotification(Notification connectToLastFmNotification)
 {
     if (Notifications == null)
     {
         Notifications = new Collection <Notification>();
     }
     if (Notifications.All(c => c.Type == connectToLastFmNotification.Type && !c.Read))
     {
         Notifications.Add(connectToLastFmNotification);
         DomainEvents.Raise(new NotificationAdded()
         {
             Artist           = this,
             LastNotification = connectToLastFmNotification
         });
     }
 }
コード例 #3
0
ファイル: NotificationFixture.cs プロジェクト: Gadarr/Gadarr
        public void should_not_have_any_default_notifications()
        {
            var notifications = Notifications.All();

            notifications.Should().BeEmpty();
        }