WriteElementsToXmlWithCalendar method

void WriteElementsToXmlWithCalendar(
  1. EwsServiceXmlWriter writer,
  2. bool isCalendarFolder
)
Writes elements to XML. The writer. If true, this permission is for a calendar folder.

Implementation

void WriteElementsToXmlWithCalendar(
    EwsServiceXmlWriter writer, bool isCalendarFolder) {
  if (this._userId != null) {
    this._userId!.WriteToXml(writer, XmlElementNames.UserId);
  }

  if (this.PermissionLevel == FolderPermissionLevel.Custom) {
    writer.WriteElementValueWithNamespace(XmlNamespace.Types,
        XmlElementNames.CanCreateItems, this.CanCreateItems);

    writer.WriteElementValueWithNamespace(XmlNamespace.Types,
        XmlElementNames.CanCreateSubFolders, this.CanCreateSubFolders);

    writer.WriteElementValueWithNamespace(XmlNamespace.Types,
        XmlElementNames.IsFolderOwner, this.IsFolderOwner);

    writer.WriteElementValueWithNamespace(XmlNamespace.Types,
        XmlElementNames.IsFolderVisible, this.IsFolderVisible);

    writer.WriteElementValueWithNamespace(XmlNamespace.Types,
        XmlElementNames.IsFolderContact, this.IsFolderContact);

    writer.WriteElementValueWithNamespace(
        XmlNamespace.Types, XmlElementNames.EditItems, this.EditItems);

    writer.WriteElementValueWithNamespace(
        XmlNamespace.Types, XmlElementNames.DeleteItems, this.DeleteItems);

    writer.WriteElementValueWithNamespace(
        XmlNamespace.Types, XmlElementNames.ReadItems, this.ReadItems);
  }

  writer.WriteElementValueWithNamespace(
      XmlNamespace.Types,
      isCalendarFolder
          ? XmlElementNames.CalendarPermissionLevel
          : XmlElementNames.PermissionLevel,
      this.PermissionLevel);
}