예제 #1
0
        public WindowEventArgs(string title, string location, DateTime startTime, DateTime endTime, string type)
        {
            if (type == "Exercise")
            {
                NewEvent = new ExerciseEvent(title, location, startTime, endTime);
            }

            this.Title = title;
            this.Location = location;
            this.StartTime = startTime;
            this.EndTime = endTime;
            this.EventType = type.ToString();
        }
 public static OrganizerEvent CreateOrganizerEvent(OrganizerEventType type, string title, string location, DateTime start, DateTime end, bool allDay, params string[] otherFields)
 {
     OrganizerEvent newEvent = null;
     switch (type)
     {
         case OrganizerEventType.Meeting:
             newEvent = new MeetingEvent(title, location, start, end);
             break;
         case OrganizerEventType.Lecture:
             newEvent = new LectureEvent(title, location, start, end);
             break;
         case OrganizerEventType.Exercise:
             newEvent = new ExerciseEvent(title, location, start, end);
             break;
         case OrganizerEventType.Deadline:
             newEvent = new DeadlineEvent(title, location, start, end);
             break;
         case OrganizerEventType.Other:
             newEvent = new OtherEvent(title, location, start, end);
             break;
     }
     return newEvent;
 }