示例#1
0
        public EventComponent(string code, int lcid, bool useReminder) : base(ComponentType.Event)
        {
            Code          = code;
            Status        = EventStatus.Confirmed;
            Class         = CalendarClassType.Public;
            Transparancy  = TransparencyType.Transparent;
            LCID          = lcid;
            RequestStatus = new List <string>();
            Attachments   = new List <AttachmentElement>();
            Resources     = new List <string>();

            if (useReminder)
            {
                Alarm = new AlarmComponent("Reminder", new PresetElementPart(null, null, 3, null, null));
            }
        }
示例#2
0
 public EventComponent(string code, int lcid, string location, DateTime startDate, DateTime?endDate, bool useReminder, PresetElementPart alarmPreset, bool isAllDayEvent = false)
     : base(ComponentType.Event)
 {
     Code          = code;
     LCID          = lcid;
     Status        = EventStatus.Confirmed;
     Class         = CalendarClassType.Public;
     Transparancy  = TransparencyType.Transparent;
     Location      = location;
     RequestStatus = new List <string>();
     Attachments   = new List <AttachmentElement>();
     Resources     = new List <string>();
     IsAllDayEvent = isAllDayEvent;
     Sequence      = 3;
     StartEvent    = IsAllDayEvent ? new DateTime(startDate.Year, startDate.Month, startDate.Day, 0, 0, 0) : startDate;
     EndEvent      = IsAllDayEvent ? startDate.AddDays(1) : (endDate ?? startDate.AddMinutes(60));
     if (useReminder)
     {
         Alarm = new AlarmComponent("Reminder", alarmPreset);
     }
 }