Beispiel #1
0
        public static async Task <Notice> GetNotice(this Event self, Instant occurrence, Event.Rule rule)
        {
            foreach (Event.Notice notice in self.Notices)
            {
                if (notice.Start.IsApproximately(occurrence))
                {
                    return(new Notice(self, notice, rule));
                }
            }

            // no notice for this occurrence, create one.
            Event.Notice newNotice = new Event.Notice();
            newNotice.Start = occurrence;
            self.Notices.Add(newNotice);
            await EventsService.SaveEvent(self);

            return(new Notice(self, newNotice, rule));
        }
Beispiel #2
0
 public Notice(Event evt, Event.Notice notice, Event.Rule rule)
 {
     this.Event       = evt;
     this.EventNotice = notice;
     this.Rule        = rule;
 }