RecurrenceInfoXmlPersistenceHelper Class
Provides methods used to serialize and de-serialize the RecurrenceInfo object.
Namespace: DevExpress.XtraScheduler.Xml
Assembly: DevExpress.XtraScheduler.v24.1.Core.dll
NuGet Package: DevExpress.Scheduler.Core
Declaration
Example
This code snippet illustrates how to set the appointment’s recurrence info from XML string using the IRecurrenceInfo.FromXml method and create an IRecurrenceInfo object using the RecurrenceInfoXmlPersistenceHelper
class.
string head = "<RecurrenceInfo ";
string startText = String.Format("Start = '{0}' " , DateTime.Today.AddHours(3));
string endText = String.Format("End = '{0}' ", DateTime.Today.AddHours(4));
string weekDays = String.Format("Weekdays='{0}' ", 10);
string id = String.Format("Id = '{0}' ", Guid.NewGuid());
string occurrenceCount = String.Format("OccurrenceCount = '{0}' ", 15);
string periodicity = String.Format("Periodicity = '{0}' ", 2);
string range = String.Format("Range = '{0}' ", 1);
string type = String.Format("Type = '{0}' ", 1);
string version = String.Format("Version = '{0}' ", 1);
string tail = " />";
string recurrenceXmlString = (head + startText + endText + weekDays +
id + occurrenceCount + periodicity + range + type + version + tail).Replace("'", "\"");
scheduler.Storage.Appointments.Clear();
Appointment apt = scheduler.Storage.CreateAppointment(AppointmentType.Pattern);
apt.Start = DateTime.Today.AddHours(3);
apt.End = apt.Start.AddHours(2);
apt.Subject = "Recurrence From XML";
// Set appointment recurrence from XML.
apt.RecurrenceInfo.FromXml(recurrenceXmlString);
// Get recurrence info from XML.
IRecurrenceInfo rec = DevExpress.XtraScheduler.Xml.RecurrenceInfoXmlPersistenceHelper.ObjectFromXml(recurrenceXmlString);
apt.Description = recurrenceXmlString + Environment.NewLine + String.Format("Type: {0}",rec.Type);
scheduler.Storage.Appointments.Add(apt);
Inheritance
Object
XmlPersistenceHelper
RecurrenceInfoXmlPersistenceHelper
See Also