RecurrenceInfoXmlPersistenceHelper Class
Provides methods used to serialize and de-serialize the RecurrenceInfo object.
Namespace: DevExpress.XtraScheduler.Xml
Assembly: DevExpress.XtraScheduler.v18.1.Core.dll
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.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/winforms-schedulercontrol-api-t224044
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);
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the RecurrenceInfoXmlPersistenceHelper class.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.