LoadFromXml method
Future<void>
LoadFromXml(
- EwsServiceXmlReader reader,
- bool clear,
- PropertySet? requestedPropertySet,
- bool onlySummaryPropertiesRequested,
Implementation
Future<void> LoadFromXml(
EwsServiceXmlReader reader,
bool clear,
PropertySet? requestedPropertySet,
bool onlySummaryPropertiesRequested) async {
if (clear) {
this.Clear();
}
// Put the property bag in "loading" mode. When in loading mode, no checking is done
// when setting property values.
this._loading = true;
this._requestedPropertySet = requestedPropertySet;
this._onlySummaryPropertiesRequested = onlySummaryPropertiesRequested;
try {
do {
await reader.Read();
if (reader.NodeType == XmlNodeType.Element) {
OutParam<PropertyDefinition> propertyDefinitionOutParam =
new OutParam<PropertyDefinition>();
if (this.Owner!.Schema.TryGetPropertyDefinition(
reader.LocalName, propertyDefinitionOutParam)) {
PropertyDefinition propertyDefinition =
propertyDefinitionOutParam.param!;
await propertyDefinition.LoadPropertyValueFromXml(reader, this);
this._loadedProperties.add(propertyDefinition);
} else {
await reader.SkipCurrentElement();
}
}
} while (!reader.IsEndElementWithNamespace(
XmlNamespace.Types, this.Owner!.GetXmlElementName()));
this.ClearChangeLog();
} finally {
this._loading = false;
}
}