/// <summary> /// Imports the todos. /// </summary> /// <param name="todos">The todos.</param> /// <returns></returns> public static IEnumerable<AppointmentInfo> ImportTodos(IUniqueComponentList<ITodo> todos) { List<AppointmentInfo> appointments = new List<AppointmentInfo>(); foreach (Todo todo in todos) { if (todo.Start != null) { string summary = todo.Summary ?? String.Empty; DateTime startDate = todo.Start.Local; //Import To-Dos as All Day events as they do not have End Date. DateTime endDate = startDate.AddDays(1); string recurrenceRule = GetSchedulerRecurrenceRule(startDate, endDate, todo); //Recurrence Exceptions are not currently supported as they can be defined //in varios ways and should be handled specifically. string recurrenceParentID = null; string description = todo.Description ?? String.Empty; string reminder = todo.Alarms.Count > 0 ? new Reminder(todo.Alarms[0].Trigger.Duration.Value.Duration()).ToString() : String.Empty; AppointmentInfo appInfo = new AppointmentInfo( summary, startDate, endDate, recurrenceRule, recurrenceParentID, reminder); appInfo.Description = description; appointments.Add(appInfo); } } return appointments; }
/// <summary> /// Imports Events, read from the iCalendar file, in RadScheduler. /// </summary> /// <param name="events">An <seealso cref="IList" /> of <seealso cref="Event" /> objects /// holding data for Event components.</param> /// <returns></returns> public static IEnumerable<AppointmentInfo> ImportEvents(IUniqueComponentList<IEvent> events) { List<AppointmentInfo> appointments = new List<AppointmentInfo>(); foreach (Event eventComponent in events) { if ((eventComponent.Start != null) && (eventComponent.End != null)) { string summary = eventComponent.Summary ?? String.Empty; DateTime startDate = eventComponent.Start.Local; DateTime endDate = eventComponent.End.Local; string recurrenceRule = GetSchedulerRecurrenceRule(startDate, endDate, eventComponent); string recurrenceParentID = null; string description = eventComponent.Description ?? String.Empty; string reminder = eventComponent.Alarms.Count > 0 ? new Reminder(eventComponent.Alarms[0].Trigger.Duration.Value.Duration()).ToString() : String.Empty; AppointmentInfo appInfo = new AppointmentInfo( summary, startDate, endDate, recurrenceRule, recurrenceParentID, reminder); appInfo.Description = description; appointments.Add(appInfo); } } return appointments; }
/// <summary> /// Imports the todos. /// </summary> /// <param name="todos">The todos.</param> /// <returns></returns> public static IEnumerable <AppointmentInfo> ImportTodos(IUniqueComponentList <ITodo> todos) { List <AppointmentInfo> appointments = new List <AppointmentInfo>(); foreach (Todo todo in todos) { if (todo.Start != null) { string summary = todo.Summary ?? String.Empty; DateTime startDate = todo.Start.Local; //Import To-Dos as All Day events as they do not have End Date. DateTime endDate = startDate.AddDays(1); string recurrenceRule = GetSchedulerRecurrenceRule(startDate, endDate, todo); //Recurrence Exceptions are not currently supported as they can be defined //in varios ways and should be handled specifically. string recurrenceParentID = null; string description = todo.Description ?? String.Empty; string reminder = todo.Alarms.Count > 0 ? new Reminder(todo.Alarms[0].Trigger.Duration.Value.Duration()).ToString() : String.Empty; AppointmentInfo appInfo = new AppointmentInfo( summary, startDate, endDate, recurrenceRule, recurrenceParentID, reminder); appInfo.Description = description; appointments.Add(appInfo); } } return(appointments); }
/// <summary> /// Imports Events, read from the iCalendar file, in RadScheduler. /// </summary> /// <param name="events">An <seealso cref="IList" /> of <seealso cref="Event" /> objects /// holding data for Event components.</param> /// <returns></returns> public static IEnumerable <AppointmentInfo> ImportEvents(IUniqueComponentList <IEvent> events) { List <AppointmentInfo> appointments = new List <AppointmentInfo>(); foreach (Event eventComponent in events) { if ((eventComponent.Start != null) && (eventComponent.End != null)) { string summary = eventComponent.Summary ?? String.Empty; DateTime startDate = eventComponent.Start.Local; DateTime endDate = eventComponent.End.Local; string recurrenceRule = GetSchedulerRecurrenceRule(startDate, endDate, eventComponent); string recurrenceParentID = null; string description = eventComponent.Description ?? String.Empty; string reminder = eventComponent.Alarms.Count > 0 ? new Reminder(eventComponent.Alarms[0].Trigger.Duration.Value.Duration()).ToString() : String.Empty; AppointmentInfo appInfo = new AppointmentInfo( summary, startDate, endDate, recurrenceRule, recurrenceParentID, reminder); appInfo.Description = description; appointments.Add(appInfo); } } return(appointments); }
private void Initialize() { _mUniqueComponents = new UniqueComponentListProxy <IUniqueComponent>(Children); _mEvents = new UniqueComponentListProxy <CalendarEvent>(Children); _mTodos = new UniqueComponentListProxy <Todo>(Children); _mJournals = new CalendarObjectListProxy <Journal>(Children); _mFreeBusy = new UniqueComponentListProxy <FreeBusy>(Children); _mTimeZones = new CalendarObjectListProxy <VTimeZone>(Children); }
private void Initialize() { Name = Components.Calendar; _mUniqueComponents = new UniqueComponentListProxy <IUniqueComponent>(Children); _mEvents = new UniqueComponentListProxy <IEvent>(Children); _mTodos = new UniqueComponentListProxy <ITodo>(Children); _mJournals = new CalendarObjectListProxy <IJournal>(Children); _mFreeBusy = new UniqueComponentListProxy <IFreeBusy>(Children); _mTimeZones = new CalendarObjectListProxy <ITimeZone>(Children); }
private void Initialize() { this.Name = Components.CALENDAR; m_UniqueComponents = new UniqueComponentListProxy <IUniqueComponent>(Children); m_Events = new UniqueComponentListProxy <IEvent>(Children); m_Todos = new UniqueComponentListProxy <ITodo>(Children); m_Journals = new CalendarObjectListProxy <IJournal>(Children); m_FreeBusy = new UniqueComponentListProxy <IFreeBusy>(Children); m_TimeZones = new CalendarObjectListProxy <ITimeZone>(Children); }
/// <summary> /// Initializes this instance. /// </summary> private void Initialize( ) { Name = Components.CALENDAR; _uniqueComponents = new UniqueComponentListProxy <IUniqueComponent>(Children); _events = new UniqueComponentListProxy <IEvent>(Children); _todos = new UniqueComponentListProxy <ITodo>(Children); _journals = new CalendarObjectListProxy <IJournal>(Children); _freeBusy = new UniqueComponentListProxy <IFreeBusy>(Children); _timeZones = new CalendarObjectListProxy <ITimeZone>(Children); }