Skip to main content
A newer version of this page is available. .

AppointmentXmlPersistenceHelper.ObjectFromXml(IAppointmentStorageBase, String) Method

Restores an appointment from an XML serialized string.

Namespace: DevExpress.XtraScheduler.Xml

Assembly: DevExpress.XtraScheduler.v19.2.Core.dll

Declaration

public static Appointment ObjectFromXml(
    IAppointmentStorageBase storage,
    string xml
)

Parameters

Name Type Description
storage IAppointmentStorageBase

An ISchedulerStorageBase object that provides an appointment factory, custom field mappings and time zone translation.

xml String

A string in XML format containing the serialized appointment.

Returns

Type Description
Appointment

An Appointment object created from the string.

Remarks

Use the ObjectFromXml method to de-serialize an appointment serialized with the PersistentObject.ToXml method.

Example

The code sample demonstrates how to deserialize an appointment, i.e., to restore it from an XML string stored in the data source bound to the scheduler.

            scheduler.Storage.Appointments.Clear();
            string xmlAppointment = @"<Appointment Version=""1"" Start=""01/13/2016 04:22:00"" 
End=""01/13/2016 05:53:00"" Label=""5"" ResourceId=""3"" Status=""2"" Subject=""Meet Andrew Miller"" />";
            Appointment objAppointment = AppointmentXmlPersistenceHelper.ObjectFromXml(scheduler.Storage.Appointments, xmlAppointment);
            scheduler.Storage.Appointments.Add(objAppointment);
            scheduler.Start = new DateTime(2016, 1, 13);

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ObjectFromXml(IAppointmentStorageBase, String) 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.

See Also