WriteSetUpdateToXml method

bool WriteSetUpdateToXml(
  1. EwsServiceXmlWriter writer,
  2. ServiceObject? ewsObject,
  3. PropertyDefinition propertyDefinition
)
override
Writes updates to XML. The writer. The ews object. Property definition.

Implementation

bool WriteSetUpdateToXml(EwsServiceXmlWriter writer, ServiceObject? ewsObject,
    PropertyDefinition propertyDefinition) {
  List<TEntry?> tempEntries = <TEntry?>[];

  for (TKey? key in this._addedEntries) {
    tempEntries.add(this._entries[key]);
  }
  for (TKey? key in this._modifiedEntries) {
    tempEntries.add(this._entries[key]);
  }

  for (TEntry? entry in tempEntries) {
    if (!entry!.WriteSetUpdateToXml(
        writer, ewsObject, propertyDefinition.XmlElementName)) {
      writer.WriteStartElement(
          XmlNamespace.Types, ewsObject!.GetSetFieldXmlElementName());
      this._WriteUriToXml(writer, entry.Key);

      writer.WriteStartElement(
          XmlNamespace.Types, ewsObject.GetXmlElementName());
      writer.WriteStartElement(
          XmlNamespace.Types, propertyDefinition.XmlElementName);
      entry.WriteToXml(writer, this.GetEntryXmlElementName(entry));
      writer.WriteEndElement();
      writer.WriteEndElement();

      writer.WriteEndElement();
    }
  }

  for (TEntry entry in this._removedEntries.values) {
    if (!entry.WriteDeleteUpdateToXml(writer, ewsObject)) {
      writer.WriteStartElement(
          XmlNamespace.Types, ewsObject!.GetDeleteFieldXmlElementName());
      this._WriteUriToXml(writer, entry.Key);
      writer.WriteEndElement();
    }
  }

  return true;
}