예제 #1
0
        //For a recurring event
        public EventModel(string id, string name, string description, TimeSpan eventStart, TimeSpan eventEnd, DateTime recurrenceStart, DateTime recurrenceEnd, DayOfWeek occurrenceDay, ProgramType type)
        {
            Occurrences          = new List <EventOccurrence>();
            RecurringOccurrences = new List <RecurringEventOccurrence>();
            Blackouts            = new List <EventBlackout>();

            Id              = id;
            Name            = name;
            Description     = description;
            ProgramCategory = type.Name;
            RecurringEventOccurrence returringOccurrence = new RecurringEventOccurrence(eventStart, eventEnd, occurrenceDay, recurrenceStart, recurrenceEnd);

            RecurringOccurrences.Add(returringOccurrence);
        }
예제 #2
0
        //For a single-time event
        public EventModel(string id, string name, string description, DateTime eventStart, DateTime eventEnd, ProgramType type)
        {
            Occurrences          = new List <EventOccurrence>();
            RecurringOccurrences = new List <RecurringEventOccurrence>();
            Blackouts            = new List <EventBlackout>();

            Id              = id;
            Name            = name;
            Description     = description;
            ProgramCategory = type.Name;
            EventOccurrence singleTimeOccurrence = new EventOccurrence(id, eventStart, eventEnd);

            Occurrences.Add(singleTimeOccurrence);
        }