ScheduleCreate Method Content Studio 5.7 SDK
Content Studio Web Content Management System

[This is preliminary documentation and is subject to change.]

Creates the specified Schedule from an Xml source.

Namespace: ContentStudio.Document.Subscription
Assembly: CSServer5 (in CSServer5.dll) Version: 5.7.5016.0 (5.7.5016.0)
Syntax

public static Schedule Create(
	XmlReader reader
)

Parameters

reader
Type: System.XmlXmlReader
The XmlReader that reads from the Xml source.

Return Value

Type: Schedule
A Schedule object that contains schedule information from the data source, if found; null (Nothing in Visual Basic) otherwise.
Exceptions

ExceptionCondition
ArgumentNullExceptionThe reader must not be null.
XmlExceptionThe data read by the XmlReader is not valid according to the schema
Remarks

This method accepts an XmlReader that reads the Xml base serialized schedule data from a repository. The method advances the reader to the next schedule element, ensures that the data conforms with the schema (see the GetValidationSchema(ValidationEventHandler) method), and advances the reader to the end of the schedule element. This makes it possible to create one Schedule object for each occurrence in the xml source as th sample code shows.
Examples

List<Schedule> GetSchedules(XmlReader reader)
{
  List<Schedule> list = new List<Schedule>();
  //as long as the reader is valid
  while(!reader.EOF)
  {
    //create a new schedule from the xml data,
    Schedule schedule = Schedule.Create(reader);
    //when the end of the data has been reached, schedule will be null
    if (schedule != null)
       list.Add(schedule);
  }
  return list;
}
See Also

Reference