示例#1
0
    void WriteElementsToXml(EwsServiceXmlWriter writer)
    {
        if (this.AssignCategories.Count > 0)
        {
            this.AssignCategories.WriteToXml(writer, XmlElementNames.AssignCategories);
        }

        if (this.CopyToFolder != null)
        {
            writer.WriteStartElement(XmlNamespace.Types, XmlElementNames.CopyToFolder);
            this.CopyToFolder.WriteToXml(writer);
            writer.WriteEndElement();
        }

        if (this.Delete != false)
        {
            writer.WriteElementValue(
                XmlNamespace.Types,
                XmlElementNames.Delete,
                this.Delete);
        }

        if (this.ForwardAsAttachmentToRecipients.Count > 0)
        {
            this.ForwardAsAttachmentToRecipients.WriteToXml(writer, XmlElementNames.ForwardAsAttachmentToRecipients);
        }

        if (this.ForwardToRecipients.Count > 0)
        {
            this.ForwardToRecipients.WriteToXml(writer, XmlElementNames.ForwardToRecipients);
        }

        if (this.MarkImportance.HasValue)
        {
            writer.WriteElementValue(
                XmlNamespace.Types,
                XmlElementNames.MarkImportance,
                this.MarkImportance.Value);
        }

        if (this.MarkAsRead != false)
        {
            writer.WriteElementValue(
                XmlNamespace.Types,
                XmlElementNames.MarkAsRead,
                this.MarkAsRead);
        }

        if (this.MoveToFolder != null)
        {
            writer.WriteStartElement(XmlNamespace.Types, XmlElementNames.MoveToFolder);
            this.MoveToFolder.WriteToXml(writer);
            writer.WriteEndElement();
        }

        if (this.PermanentDelete != false)
        {
            writer.WriteElementValue(
                XmlNamespace.Types,
                XmlElementNames.PermanentDelete,
                this.PermanentDelete);
        }

        if (this.RedirectToRecipients.Count > 0)
        {
            this.RedirectToRecipients.WriteToXml(writer, XmlElementNames.RedirectToRecipients);
        }

        if (this.SendSMSAlertToRecipients.Count > 0)
        {
            EmailAddressCollection emailCollection = ConvertSMSRecipientsFromMobilePhoneCollectionToEmailAddressCollection(this.SendSMSAlertToRecipients);
            emailCollection.WriteToXml(writer, XmlElementNames.SendSMSAlertToRecipients);
        }

        if (this.ServerReplyWithMessage != null)
        {
            this.ServerReplyWithMessage.WriteToXml(writer, XmlElementNames.ServerReplyWithMessage);
        }

        if (this.StopProcessingRules != false)
        {
            writer.WriteElementValue(
                XmlNamespace.Types,
                XmlElementNames.StopProcessingRules,
                this.StopProcessingRules);
        }
    }