public Distributor(NotificationStore notificationStore)
        {
            this.notificationStore = notificationStore;

            // 发送新的通知情况
            notificationStore.NewNotificationOccured +=
                OnNewNotificationOccured;
        }
        public NotificationGenerator(
            EventStore eventStore,
            NotificationStore notificationStore,
            ArticleSubscriptionStore articleSubscriptionStore)
        {
            this.eventStore               = eventStore;
            this.notificationStore        = notificationStore;
            this.articleSubscriptionStore = articleSubscriptionStore;

            // 接收新的预定事件
            eventStore.NewEventOccured += OnNewEventOccured;
        }
示例#3
0
 void InitPersistence()
 {
     articleStore = new ArticleStore();
     articleX     = new Article("X", string.Empty);
     articleY     = new Article("Y", string.Empty);
     articleZ     = new Article("Z", string.Empty);
     articleStore.Save(articleX);
     articleStore.Save(articleY);
     articleStore.Save(articleZ);
     articleSubscriptionStore = new ArticleSubscriptionStore();
     eventStore        = new EventStore();
     notificationStore = new NotificationStore();
 }