WriteSetUpdateToXml method
bool
WriteSetUpdateToXml(
- EwsServiceXmlWriter writer,
- ServiceObject? ewsObject,
- String? ownerDictionaryXmlElementName
override
Implementation
@override
bool WriteSetUpdateToXml(EwsServiceXmlWriter writer, ServiceObject? ewsObject,
String? ownerDictionaryXmlElementName) {
List<String> fieldsToSet = <String>[];
for (String xmlElementName in this._propertyBag.AddedItems) {
fieldsToSet.add(xmlElementName);
}
for (String xmlElementName in this._propertyBag.ModifiedItems) {
fieldsToSet.add(xmlElementName);
}
for (String xmlElementName in fieldsToSet) {
writer.WriteStartElement(
XmlNamespace.Types, ewsObject!.GetSetFieldXmlElementName());
writer.WriteStartElement(
XmlNamespace.Types, XmlElementNames.IndexedFieldURI);
writer.WriteAttributeValue(
XmlAttributeNames.FieldURI, _GetFieldUri(xmlElementName));
writer.WriteAttributeValue(XmlAttributeNames.FieldIndex, this.Key);
writer.WriteEndElement(); // IndexedFieldURI
writer.WriteStartElement(
XmlNamespace.Types, ewsObject.GetXmlElementName());
writer.WriteStartElement(
XmlNamespace.Types, ownerDictionaryXmlElementName);
writer.WriteStartElement(XmlNamespace.Types, XmlElementNames.Entry);
this.WriteAttributesToXml(writer);
writer.WriteElementValueWithNamespace(XmlNamespace.Types, xmlElementName,
this._propertyBag[xmlElementName]);
writer.WriteEndElement(); // Entry
writer.WriteEndElement(); // ownerDictionaryXmlElementName
writer.WriteEndElement(); // ewsObject.GetXmlElementName()
writer.WriteEndElement(); // ewsObject.GetSetFieldXmlElementName()
}
for (String xmlElementName in this._propertyBag.RemovedItems) {
this._InternalWriteDeleteFieldToXml(writer, ewsObject!, xmlElementName);
}
return true;
}