ReadServiceObjectsCollectionFromXmlWithNamespace<TServiceObject extends ServiceObject> method
Future<List<TServiceObject> >
ReadServiceObjectsCollectionFromXmlWithNamespace<TServiceObject extends ServiceObject>(
- XmlNamespace collectionXmlNamespace,
- String collectionXmlElementName,
- IGetObjectInstanceDelegate<
TServiceObject> getObjectInstanceDelegate, - bool clearPropertyBag,
- PropertySet? requestedPropertySet,
- bool summaryPropertiesOnly,
Implementation
// DateTime ReadElementValueAsUnbiasedDateTimeScopedToServiceTimeZone()
// {
// String elementValue = this.ReadElementValue<String>();
// return EwsUtilities.ParseAsUnbiasedDatetimescopedToServicetimeZone(elementValue, this.Service);
// }
/// <summary>
/// Reads the element value as date time.
/// </summary>
/// <param name="xmlNamespace">The XML namespace.</param>
/// <param name="localName">Name of the local.</param>
/// <returns>Element value.</returns>
// DateTime ReadElementValueAsDateTime(XmlNamespace xmlNamespace, String localName)
// {
// return this.ConvertStringToDateTime(this.ReadElementValueWithNamespace(xmlNamespace, localName));
// }
/// <summary>
/// Reads the service objects collection from XML.
/// </summary>
/// <typeparam name="TServiceObject">The type of the service object.</typeparam>
/// <param name="collectionXmlNamespace">Namespace of the collection XML element.</param>
/// <param name="collectionXmlElementName">Name of the collection XML element.</param>
/// <param name="getObjectInstanceDelegate">The get object instance delegate.</param>
/// <param name="clearPropertyBag">if set to <c>true</c> [clear property bag].</param>
/// <param name="requestedPropertySet">The requested property set.</param>
/// <param name="summaryPropertiesOnly">if set to <c>true</c> [summary properties only].</param>
/// <returns>List of service objects.</returns>
Future<List<TServiceObject>> ReadServiceObjectsCollectionFromXmlWithNamespace<
TServiceObject extends ServiceObject
>(
XmlNamespace collectionXmlNamespace,
String collectionXmlElementName,
IGetObjectInstanceDelegate<TServiceObject> getObjectInstanceDelegate,
bool clearPropertyBag,
PropertySet? requestedPropertySet,
bool summaryPropertiesOnly,
) async {
List<TServiceObject> serviceObjects = <TServiceObject>[];
TServiceObject? serviceObject;
if (!IsStartElementWithNamespace(
collectionXmlNamespace,
collectionXmlElementName,
)) {
await ReadStartElementWithNamespace(
collectionXmlNamespace,
collectionXmlElementName,
);
}
if (!IsEmptyElement) {
do {
await Read();
if (IsStartElement()) {
serviceObject = getObjectInstanceDelegate(Service, LocalName);
if (LocalName != serviceObject.GetXmlElementName()) {
throw ServiceLocalException(
"The type of the object in the store ($LocalName) does not match that of the local object (${serviceObject.GetXmlElementName()}).",
);
}
await serviceObject.LoadFromXmlWithPropertySet(
this,
clearPropertyBag,
requestedPropertySet,
summaryPropertiesOnly,
);
serviceObjects.add(serviceObject);
}
} while (!IsEndElementWithNamespace(
collectionXmlNamespace,
collectionXmlElementName,
));
}
return serviceObjects;
}