public override object ObjectFromXml() { EventItem ev = new EventItem(); ev.Type = ReadAttributeAsInt("Type", 0); ev.StartTime = ReadAttributeAsDateTime("Start", DateTime.MinValue); ev.EndTime = ReadAttributeAsDateTime("End", DateTime.MinValue); ev.Label = ReadAttributeAsInt("Label", 0); ev.Description = ReadAttributeAsString("Description", String.Empty); ev.Location = ReadAttributeAsString("Location", String.Empty); ev.ResourceId = ReadAttributeAsString("ResourceId", String.Empty); ev.Status = ReadAttributeAsInt("Status", 0); ev.Subject = ReadAttributeAsString("Subject", String.Empty); ev.Price = ReadAttributeAsInt("Price", 0); ev.RecurrenceInfo = ReadChildNodesAsString("RecurrenceInfo", String.Empty); ev.ReminderInfo = ReadChildNodesAsString("Reminder", String.Empty); return(ev); }
static EventItem CreateEventItemFromAppointment(Appointment appointment) { EventItem item = new EventItem(); if (appointment.Reminder != null) { item.ReminderInfo = CreateReminderString(appointment); } item.Description = appointment.Description; item.AllDay = appointment.AllDay; item.EndTime = appointment.End; item.Label = appointment.LabelKey; item.Location = appointment.Location; if (appointment.RecurrenceInfo != null) { item.RecurrenceInfo = appointment.RecurrenceInfo.ToXml(); } item.ResourceId = appointment.ResourceId; item.StartTime = appointment.Start; item.Status = appointment.StatusKey; item.Subject = appointment.Subject; item.Type = appointment.Type; return(item); }