/// <summary>
 /// Tries to read element from XML.
 /// </summary>
 /// <param name="reader">The reader.</param>
 /// <returns>True if element was read.</returns>
 internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
 {
     switch (reader.LocalName)
     {
         case XmlElementNames.AssignCategories:
             this.assignCategories.LoadFromXml(reader, reader.LocalName);
             return true;
         case XmlElementNames.CopyToFolder:
             reader.ReadStartElement(XmlNamespace.NotSpecified, XmlElementNames.FolderId);
             this.copyToFolder = new FolderId();
             this.copyToFolder.LoadFromXml(reader, XmlElementNames.FolderId);
             reader.ReadEndElement(XmlNamespace.NotSpecified, XmlElementNames.CopyToFolder);
             return true;
         case XmlElementNames.Delete:
             this.delete = reader.ReadElementValue<bool>();
             return true;
         case XmlElementNames.ForwardAsAttachmentToRecipients:
             this.forwardAsAttachmentToRecipients.LoadFromXml(reader, reader.LocalName);
             return true;
         case XmlElementNames.ForwardToRecipients:
             this.forwardToRecipients.LoadFromXml(reader, reader.LocalName);
             return true;
         case XmlElementNames.MarkImportance:
             this.markImportance = reader.ReadElementValue<Importance>();
             return true;
         case XmlElementNames.MarkAsRead:
             this.markAsRead = reader.ReadElementValue<bool>();
             return true;
         case XmlElementNames.MoveToFolder:
             reader.ReadStartElement(XmlNamespace.NotSpecified, XmlElementNames.FolderId);
             this.moveToFolder = new FolderId();
             this.moveToFolder.LoadFromXml(reader, XmlElementNames.FolderId);
             reader.ReadEndElement(XmlNamespace.NotSpecified, XmlElementNames.MoveToFolder);
             return true;
         case XmlElementNames.PermanentDelete:
             this.permanentDelete = reader.ReadElementValue<bool>();
             return true;
         case XmlElementNames.RedirectToRecipients:
             this.redirectToRecipients.LoadFromXml(reader, reader.LocalName);
             return true;
         case XmlElementNames.SendSMSAlertToRecipients:
             EmailAddressCollection smsRecipientCollection = new EmailAddressCollection(XmlElementNames.Address);
             smsRecipientCollection.LoadFromXml(reader, reader.LocalName);
             this.sendSMSAlertToRecipients = ConvertSMSRecipientsFromEmailAddressCollectionToMobilePhoneCollection(smsRecipientCollection);
             return true;
         case XmlElementNames.ServerReplyWithMessage:
             this.serverReplyWithMessage = new ItemId();
             this.serverReplyWithMessage.LoadFromXml(reader, reader.LocalName);
             return true;
         case XmlElementNames.StopProcessingRules:
             this.stopProcessingRules = reader.ReadElementValue<bool>();
             return true;
         default:
             return false;
     }
 }
Exemple #2
0
    bool TryReadElementFromXml(EwsServiceXmlReader reader)
    {
        switch (reader.LocalName)
        {
        case XmlElementNames.AssignCategories:
            this.assignCategories.LoadFromXml(reader, reader.LocalName);
            return(true);

        case XmlElementNames.CopyToFolder:
            reader.ReadStartElement(XmlNamespace.NotSpecified, XmlElementNames.FolderId);
            this.copyToFolder = new FolderId();
            this.copyToFolder.LoadFromXml(reader, XmlElementNames.FolderId);
            reader.ReadEndElement(XmlNamespace.NotSpecified, XmlElementNames.CopyToFolder);
            return(true);

        case XmlElementNames.Delete:
            this.delete = reader.ReadElementValue <bool>();
            return(true);

        case XmlElementNames.ForwardAsAttachmentToRecipients:
            this.forwardAsAttachmentToRecipients.LoadFromXml(reader, reader.LocalName);
            return(true);

        case XmlElementNames.ForwardToRecipients:
            this.forwardToRecipients.LoadFromXml(reader, reader.LocalName);
            return(true);

        case XmlElementNames.MarkImportance:
            this.markImportance = reader.ReadElementValue <Importance>();
            return(true);

        case XmlElementNames.MarkAsRead:
            this.markAsRead = reader.ReadElementValue <bool>();
            return(true);

        case XmlElementNames.MoveToFolder:
            reader.ReadStartElement(XmlNamespace.NotSpecified, XmlElementNames.FolderId);
            this.moveToFolder = new FolderId();
            this.moveToFolder.LoadFromXml(reader, XmlElementNames.FolderId);
            reader.ReadEndElement(XmlNamespace.NotSpecified, XmlElementNames.MoveToFolder);
            return(true);

        case XmlElementNames.PermanentDelete:
            this.permanentDelete = reader.ReadElementValue <bool>();
            return(true);

        case XmlElementNames.RedirectToRecipients:
            this.redirectToRecipients.LoadFromXml(reader, reader.LocalName);
            return(true);

        case XmlElementNames.SendSMSAlertToRecipients:
            EmailAddressCollection smsRecipientCollection = new EmailAddressCollection(XmlElementNames.Address);
            smsRecipientCollection.LoadFromXml(reader, reader.LocalName);
            this.sendSMSAlertToRecipients = ConvertSMSRecipientsFromEmailAddressCollectionToMobilePhoneCollection(smsRecipientCollection);
            return(true);

        case XmlElementNames.ServerReplyWithMessage:
            this.serverReplyWithMessage = new ItemId();
            this.serverReplyWithMessage.LoadFromXml(reader, reader.LocalName);
            return(true);

        case XmlElementNames.StopProcessingRules:
            this.stopProcessingRules = reader.ReadElementValue <bool>();
            return(true);

        default:
            return(false);
        }
    }