LoadFromXml method
void
LoadFromXml(
- EwsServiceXmlReader reader,
- bool clear,
- PropertySet? requestedPropertySet,
- bool onlySummaryPropertiesRequested,
Implementation
void LoadFromXml(EwsServiceXmlReader reader, bool clear,
PropertySet? requestedPropertySet, bool onlySummaryPropertiesRequested) {
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 {
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!;
propertyDefinition.LoadPropertyValueFromXml(reader, this);
this._loadedProperties.add(propertyDefinition);
} else {
reader.SkipCurrentElement();
}
}
} while (!reader.IsEndElementWithNamespace(
XmlNamespace.Types, this.Owner!.GetXmlElementName()));
this.ClearChangeLog();
} finally {
this._loading = false;
}
}