/// <summary> /// Imports Journals, read from the iCalendar file, as All Day events in RadScheduler. /// </summary> /// <param name="todos">An <see cref="IList"/> of <seealso cref="Journal"/> objects holding data for /// Journal components.</param> public static IEnumerable<AppointmentInfo> ImportJournals(ICalendarObjectList<IJournal> journals) { List<AppointmentInfo> appointments = new List<AppointmentInfo>(); foreach (Journal journal in journals) { if (journal.Start != null) { string summary = journal.Summary ?? String.Empty; DateTime startDate = journal.Start.Local; //Import Journals as All Day events as they do not have End Date. DateTime endDate = startDate.AddDays(1); string recurrenceRule = GetSchedulerRecurrenceRule(startDate, endDate, journal); //Recurrence Exceptions are not currently supported as they can be defined //in varios ways and should be handled specifically. string recurrenceParentID = null; string description = journal.Description ?? String.Empty; string reminder = journal.Alarms.Count > 0 ? new Reminder(journal.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 Journals, read from the iCalendar file, as All Day events in RadScheduler. /// </summary> /// <param name="todos">An <see cref="IList"/> of <seealso cref="Journal"/> objects holding data for /// Journal components.</param> public static IEnumerable <AppointmentInfo> ImportJournals(ICalendarObjectList <IJournal> journals) { List <AppointmentInfo> appointments = new List <AppointmentInfo>(); foreach (Journal journal in journals) { if (journal.Start != null) { string summary = journal.Summary ?? String.Empty; DateTime startDate = journal.Start.Local; //Import Journals as All Day events as they do not have End Date. DateTime endDate = startDate.AddDays(1); string recurrenceRule = GetSchedulerRecurrenceRule(startDate, endDate, journal); //Recurrence Exceptions are not currently supported as they can be defined //in varios ways and should be handled specifically. string recurrenceParentID = null; string description = journal.Description ?? String.Empty; string reminder = journal.Alarms.Count > 0 ? new Reminder(journal.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); }
void Initialize() { _Children = new CalendarObjectList(this); _ServiceProvider = new ServiceProvider(); _Children.ItemAdded += new EventHandler <ObjectEventArgs <ICalendarObject, int> >(_Children_ItemAdded); _Children.ItemRemoved += new EventHandler <ObjectEventArgs <ICalendarObject, int> >(_Children_ItemRemoved); }
/// <summary> /// Initializes this instance. /// </summary> private void Initialize( ) { _children = new CalendarObjectList(this); _serviceProvider = new ServiceProvider( ); _children.ItemAdded += _Children_ItemAdded; _children.ItemRemoved += _Children_ItemRemoved; }
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() { //ToDo: I'm fairly certain this is ONLY used for null checking. If so, maybe it can just be a bool? CalendarObjectList is an empty object, and //ToDo: its constructor parameter is ignored _children = new CalendarObjectList(this); _serviceProvider = new ServiceProvider(); _children.ItemAdded += Children_ItemAdded; }
private void Initialize() { this.Name = Components.TIMEZONE; m_Evaluator = new TimeZoneEvaluator(this); m_TimeZoneInfos = new CalendarObjectListProxy <ITimeZoneInfo>(Children); Children.ItemAdded += new EventHandler <ObjectEventArgs <ICalendarObject, int> >(Children_ItemAdded); Children.ItemRemoved += new EventHandler <ObjectEventArgs <ICalendarObject, int> >(Children_ItemRemoved); SetService(m_Evaluator); }
/// <summary> /// Initializes this instance. /// </summary> private void Initialize( ) { Name = Components.TIMEZONE; _evaluator = new TimeZoneEvaluator(this); _timeZoneInfos = new CalendarObjectListProxy <ITimeZoneInfo>(Children); Children.ItemAdded += Children_ItemAdded; Children.ItemRemoved += Children_ItemRemoved; SetService(_evaluator); }
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); }
private void Initialize() { this.Name = Components.TIMEZONE; m_Evaluator = new TimeZoneEvaluator(this); m_TimeZoneInfos = new CalendarObjectListProxy<ITimeZoneInfo>(Children); Children.ItemAdded += new EventHandler<ObjectEventArgs<ICalendarObject, int>>(Children_ItemAdded); Children.ItemRemoved += new EventHandler<ObjectEventArgs<ICalendarObject, int>>(Children_ItemRemoved); SetService(m_Evaluator); }
/// <summary> /// Generates the email. /// </summary> /// <exception cref="System.ArgumentNullException"> /// eventEntity /// or /// inbox /// or /// iCal /// </exception> private static SentICalEmailMessage GenerateEmail(Appointment appointment, TenantEmailSetting emailServerSettings, iCalendar iCal) { if (appointment.ICalAppt == null) { throw new ArgumentNullException("eventEntity"); } if (emailServerSettings == null) { throw new ArgumentNullException("emailServerSettings"); } if (iCal == null) { throw new ArgumentNullException("iCal"); } ///// // Create the new email message. ///// var emailMessage = Entity.Create <SentICalEmailMessage>( ); emailMessage.Name = GlobalStrings.SoftwarePlatformCalendarInvite; ///// // Body. ///// if (appointment.Description != null) { emailMessage.EmBody = appointment.Description; } ///// // From. ///// emailMessage.EmFrom = emailServerSettings.EmailNoReplyAddress; // This will need to be chagned to something else ///// // Is Html. ///// emailMessage.EmIsHtml = true; ///// // Send date. ///// emailMessage.EmSentDate = DateTime.UtcNow; ///// // Subject. ///// emailMessage.EmSubject = !string.IsNullOrEmpty(appointment.Name) ? string.Format(GlobalStrings.ValidCalendarEmailSubject, appointment.Name) : GlobalStrings.InvalidCalendarEmailSubject; ///// // Indicate that the event was cancelled on the subject line. ///// if (iCal.Method == Methods.Cancel) { emailMessage.EmSubject = string.Format("{0}: {1}", GlobalStrings.Cancelled, emailMessage.EmSubject); } ///// // Attendees. ///// var attendees = new List <string>( ); ///// // To add the organizer as a recipient of the email, uncomment the following line. ///// //attendees.Add( "Software Platform " + inbox.InboxEmailAddress ); var attendeesEmails = GetAttendeesAddresses(appointment.EventEmailAttendees); attendees.AddRange(attendeesEmails.Select(a => string.Format("{0} {1}", a.EmailContactDisplayName, a.Name).Trim())); ///// // Process the attendees. ///// if (appointment.EventEmailAttendees != null) { emailMessage.EmTo = string.Join(";", attendees.ToArray( )); } ICalendarObjectList <ITimeZone> timeZones = iCal.TimeZones; ///// // Store the time zone id so that any new proposed times will exist in the same time zone. ///// if (timeZones != null) { ITimeZone timeZone = timeZones.FirstOrDefault( ); if (timeZone != null) { emailMessage.ICalTimeZone = timeZone.TzId; } } ///// // Store a reference to the original event email entity. ///// emailMessage.OwnerEventEmail = appointment.ICalAppt; emailMessage.SentFromEmailServer = emailServerSettings; emailMessage.Save( ); return(emailMessage); }