corelibraries-devexpress-dot-xtrascheduler-dot-irecurrenceinfo-e5b421b4.md
Creates an XML encoding of the recurrence information.
Namespace : DevExpress.XtraScheduler
Assembly : DevExpress.XtraScheduler.v25.2.Core.dll
NuGet Package : DevExpress.Scheduler.Core
string ToXml()
Function ToXml As String
| Type | Description |
|---|---|
| String |
A String value that represents an XML encoding of the recurrence information object.
|
This example illustrates the use of the IRecurrenceInfo.ToXml method to obtain recurrence info in XML format.
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 = "TEST";
apt.RecurrenceInfo.Type = RecurrenceType.Weekly;
apt.RecurrenceInfo.Start = apt.Start;
apt.RecurrenceInfo.Periodicity = 2;
apt.RecurrenceInfo.WeekDays = WeekDays.Monday | WeekDays.Wednesday;
apt.RecurrenceInfo.Range = RecurrenceRange.OccurrenceCount;
apt.RecurrenceInfo.OccurrenceCount = 15;
string s = DevExpress.XtraScheduler.iCalendar.iCalendarHelper.ExtractRecurrenceRule(apt.RecurrenceInfo);
apt.Description = "RRULE:" + s + Environment.NewLine;
scheduler.Storage.Appointments.Add(apt);
apt.Description += apt.RecurrenceInfo.ToXml();
scheduler.Storage.Appointments.Clear()
Dim apt As Appointment = scheduler.Storage.CreateAppointment(AppointmentType.Pattern)
apt.Start = Date.Today.AddHours(3)
apt.End = apt.Start.AddHours(2)
apt.Subject = "TEST"
apt.RecurrenceInfo.Type = RecurrenceType.Weekly
apt.RecurrenceInfo.Start = apt.Start
apt.RecurrenceInfo.Periodicity = 2
apt.RecurrenceInfo.WeekDays = WeekDays.Monday Or WeekDays.Wednesday
apt.RecurrenceInfo.Range = RecurrenceRange.OccurrenceCount
apt.RecurrenceInfo.OccurrenceCount = 15
Dim s As String = DevExpress.XtraScheduler.iCalendar.iCalendarHelper.ExtractRecurrenceRule(apt.RecurrenceInfo)
apt.Description = "RRULE:" & s & Environment.NewLine
scheduler.Storage.Appointments.Add(apt)
apt.Description += apt.RecurrenceInfo.ToXml()
The following code snippets (auto-collected from DevExpress Examples) contain references to the ToXml() method.
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.
wpf-scheduler-use-entity-framework-to-bind-to-data/CS/DXSample/Data/DataHelper.cs#L219
};
appt.RecurrenceInfo = RecurrenceBuilder.Weekly(newStart, 10).ByDay(WeekDays.Monday | WeekDays.Wednesday).Build().ToXml();
return appt;
wpf-scheduler-filter-time-regions/CS/DXSample/Data/DataHelper.cs#L241
};
appt.RecurrenceInfo = RecurrenceBuilder.Weekly(newStart, 10)
.ByDay(WeekDays.Monday | WeekDays.Wednesday)
apt.RecurrenceInfo.WeekDays = WeekDays.WorkDays;
scheduledJob.SerializedRecurrenceInfo = apt.RecurrenceInfo.ToXml();
}
appt.Type = (int)AppointmentType.Pattern;
appt.RecurrenceInfo = RecurrenceBuilder.Daily(Interval.Start, 10).Build().ToXml();
} else {
wpf-scheduler-use-entity-framework-to-bind-to-data/VB/DXSample/Data/DataHelper.vb#L122
Dim appt = New DXSample.Data.AppointmentEntity() With {.AppointmentType = CInt(DevExpress.XtraScheduler.AppointmentType.Pattern), .Start = newStart, .[End] = newEnd, .ResourceId = 2, .Subject = "French lesson", .Label = 3, .Description = "Another french lesson.Once again, without mastering French, our success on the Continent will be less likely.Everyone needs to learn French."}
appt.RecurrenceInfo = DevExpress.Xpf.Scheduling.RecurrenceBuilder.Weekly(CDate((newStart)), CInt((10))).ByDay(CType((DevExpress.XtraScheduler.WeekDays.Monday Or DevExpress.XtraScheduler.WeekDays.Wednesday), DevExpress.XtraScheduler.WeekDays)).Build().ToXml()
Return appt
wpf-scheduler-filter-time-regions/VB/DXSample/Data/DataHelper.vb#L122
Dim appt = New DXSample.Data.AppointmentEntity() With {.AppointmentType = CInt(DevExpress.XtraScheduler.AppointmentType.Pattern), .Start = newStart, .[End] = newEnd, .ResourceId = 2, .Subject = "French lesson", .Label = 3, .Description = "Another french lesson.Once again, without mastering French, our success on the Continent will be less likely.Everyone needs to learn French."}
appt.RecurrenceInfo = DevExpress.Xpf.Scheduling.RecurrenceBuilder.Weekly(CDate((newStart)), CInt((10))).ByDay(CType((DevExpress.XtraScheduler.WeekDays.Monday Or DevExpress.XtraScheduler.WeekDays.Wednesday), DevExpress.XtraScheduler.WeekDays)).Build().ToXml()
Return appt
apt.RecurrenceInfo.WeekDays = WeekDays.WorkDays
scheduledJob.SerializedRecurrenceInfo = apt.RecurrenceInfo.ToXml()
End Using
appt.Type = CInt(DevExpress.XtraScheduler.AppointmentType.Pattern)
appt.RecurrenceInfo = DevExpress.Xpf.Scheduling.RecurrenceBuilder.Daily(CDate((Me.Interval.Start)), CInt((10))).Build().ToXml()
Else
See Also