Beispiel #1
0
        /// <summary>
        /// Tries to read element from XML.
        /// </summary>
        /// <param name="reader">The reader.</param>
        /// <returns>True if appropriate element was read.</returns>
        internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
        {
            switch (reader.LocalName)
            {
            case XmlElementNames.OofState:
                this.state = reader.ReadValue <OofState>();
                return(true);

            case XmlElementNames.ExternalAudience:
                this.externalAudience = reader.ReadValue <OofExternalAudience>();
                return(true);

            case XmlElementNames.Duration:
                this.duration = new TimeWindow();
                this.duration.LoadFromXml(reader);
                return(true);

            case XmlElementNames.InternalReply:
                this.internalReply = new OofReply();
                this.internalReply.LoadFromXml(reader, reader.LocalName);
                return(true);

            case XmlElementNames.ExternalReply:
                this.externalReply = new OofReply();
                this.externalReply.LoadFromXml(reader, reader.LocalName);
                return(true);

            default:
                return(false);
            }
        }
        /// <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.UserId:
                this.UserId = new UserId();
                this.UserId.LoadFromXml(reader, reader.LocalName);
                return(true);

            case XmlElementNames.CanCreateItems:
                this.canCreateItems = reader.ReadValue <bool>();
                return(true);

            case XmlElementNames.CanCreateSubFolders:
                this.canCreateSubFolders = reader.ReadValue <bool>();
                return(true);

            case XmlElementNames.IsFolderOwner:
                this.isFolderOwner = reader.ReadValue <bool>();
                return(true);

            case XmlElementNames.IsFolderVisible:
                this.isFolderVisible = reader.ReadValue <bool>();
                return(true);

            case XmlElementNames.IsFolderContact:
                this.isFolderContact = reader.ReadValue <bool>();
                return(true);

            case XmlElementNames.EditItems:
                this.editItems = reader.ReadValue <PermissionScope>();
                return(true);

            case XmlElementNames.DeleteItems:
                this.deleteItems = reader.ReadValue <PermissionScope>();
                return(true);

            case XmlElementNames.ReadItems:
                this.readItems = reader.ReadValue <FolderPermissionReadAccess>();
                return(true);

            case XmlElementNames.PermissionLevel:
            case XmlElementNames.CalendarPermissionLevel:
                this.permissionLevel = reader.ReadValue <FolderPermissionLevel>();
                return(true);

            default:
                return(false);
            }
        }
        /// <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.LocationDisplayName:
                this.displayName = reader.ReadValue <string>();
                return(true);

            case XmlElementNames.LocationAnnotation:
                this.annotation = reader.ReadValue <string>();
                return(true);

            case XmlElementNames.PersonaPostalAddress:
                this.personaPostalAddress = new PersonaPostalAddress();
                this.personaPostalAddress.LoadFromXml(reader);
                this.personaPostalAddress.OnChange += new ComplexPropertyChangedDelegate(PersonaPostalAddress_OnChange);
                return(true);

            default:
                return(false);
            }
        }
Beispiel #4
0
        /// <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)
        {
            if (reader.LocalName == this.itemXmlElementName)
            {
                this.Add(reader.ReadValue());

                return(true);
            }
            else
            {
                return(false);
            }
        }
        /// <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.CanDelete:
                this.canDelete = reader.ReadValue <bool>();
                return(true);

            case XmlElementNames.CanRenameOrMove:
                this.canRenameOrMove = reader.ReadValue <bool>();
                return(true);

            case XmlElementNames.MustDisplayComment:
                this.mustDisplayComment = reader.ReadValue <bool>();
                return(true);

            case XmlElementNames.HasQuota:
                this.hasQuota = reader.ReadValue <bool>();
                return(true);

            case XmlElementNames.IsManagedFoldersRoot:
                this.isManagedFoldersRoot = reader.ReadValue <bool>();
                return(true);

            case XmlElementNames.ManagedFolderId:
                this.managedFolderId = reader.ReadValue();
                return(true);

            case XmlElementNames.Comment:
                reader.TryReadValue(ref this.comment);
                return(true);

            case XmlElementNames.StorageQuota:
                this.storageQuota = reader.ReadValue <int>();
                return(true);

            case XmlElementNames.FolderSize:
                this.folderSize = reader.ReadValue <int>();
                return(true);

            case XmlElementNames.HomePage:
                reader.TryReadValue(ref this.homePage);
                return(true);

            default:
                return(false);
            }
        }
Beispiel #6
0
        /// <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.SID:
                this.sID = reader.ReadValue();
                return(true);

            case XmlElementNames.PrimarySmtpAddress:
                this.primarySmtpAddress = reader.ReadValue();
                return(true);

            case XmlElementNames.DisplayName:
                this.displayName = reader.ReadValue();
                return(true);

            case XmlElementNames.DistinguishedUser:
                this.standardUser = reader.ReadValue <StandardUser>();
                return(true);

            default:
                return(false);
            }
        }
Beispiel #7
0
        /// <summary>
        /// Load from XML.
        /// </summary>
        /// <param name="reader">The reader.</param>
        internal override void InternalLoadFromXml(EwsServiceXmlReader reader)
        {
            base.InternalLoadFromXml(reader);

            this.folderId = new FolderId();
            this.folderId.LoadFromXml(reader, reader.LocalName);

            reader.Read();

            this.ParentFolderId = new FolderId();
            this.ParentFolderId.LoadFromXml(reader, XmlElementNames.ParentFolderId);

            switch (this.EventType)
            {
            case EventType.Moved:
            case EventType.Copied:
                reader.Read();

                this.oldFolderId = new FolderId();
                this.oldFolderId.LoadFromXml(reader, reader.LocalName);

                reader.Read();

                this.OldParentFolderId = new FolderId();
                this.OldParentFolderId.LoadFromXml(reader, reader.LocalName);
                break;

            case EventType.Modified:
                reader.Read();
                if (reader.IsStartElement())
                {
                    reader.EnsureCurrentNodeIsStartElement(XmlNamespace.Types, XmlElementNames.UnreadCount);
                    this.unreadCount = int.Parse(reader.ReadValue());
                }
                break;

            default:
                break;
            }
        }
 /// <summary>
 /// Reads text value from XML.
 /// </summary>
 /// <param name="reader">The reader.</param>
 internal override void ReadTextValueFromXml(EwsServiceXmlReader reader)
 {
     this.content = System.Convert.FromBase64String(reader.ReadValue());
 }
Beispiel #9
0
 /// <summary>
 /// Reads the text value from XML.
 /// </summary>
 /// <param name="reader">The reader.</param>
 internal override void ReadTextValueFromXml(EwsServiceXmlReader reader)
 {
     this.EmailAddress.Address = reader.ReadValue();
 }
Beispiel #10
0
 /// <summary>
 /// Reads the text value from XML.
 /// </summary>
 /// <param name="reader">The reader.</param>
 internal override void ReadTextValueFromXml(EwsServiceXmlReader reader)
 {
     this.phoneNumber = reader.ReadValue();
 }
 /// <summary>
 /// Reads text value from XML.
 /// </summary>
 /// <param name="reader">The reader.</param>
 internal override void ReadTextValueFromXml(EwsServiceXmlReader reader)
 {
     this.retentionId = new Guid(reader.ReadValue());
 }
        /// <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.Street:
                this.street = reader.ReadValue <string>();
                return(true);

            case XmlElementNames.City:
                this.city = reader.ReadValue <string>();
                return(true);

            case XmlElementNames.State:
                this.state = reader.ReadValue <string>();
                return(true);

            case XmlElementNames.Country:
                this.country = reader.ReadValue <string>();
                return(true);

            case XmlElementNames.PostalCode:
                this.postalCode = reader.ReadValue <string>();
                return(true);

            case XmlElementNames.PostOfficeBox:
                this.postOfficeBox = reader.ReadValue <string>();
                return(true);

            case XmlElementNames.PostalAddressType:
                this.type = reader.ReadValue <string>();
                return(true);

            case XmlElementNames.Latitude:
                this.latitude = reader.ReadValue <double>();
                return(true);

            case XmlElementNames.Longitude:
                this.longitude = reader.ReadValue <double>();
                return(true);

            case XmlElementNames.Accuracy:
                this.accuracy = reader.ReadValue <double>();
                return(true);

            case XmlElementNames.Altitude:
                this.altitude = reader.ReadValue <double>();
                return(true);

            case XmlElementNames.AltitudeAccuracy:
                this.altitudeAccuracy = reader.ReadValue <double>();
                return(true);

            case XmlElementNames.FormattedAddress:
                this.formattedAddress = reader.ReadValue <string>();
                return(true);

            case XmlElementNames.LocationUri:
                this.uri = reader.ReadValue <string>();
                return(true);

            case XmlElementNames.LocationSource:
                this.source = reader.ReadValue <LocationSource>();
                return(true);

            default:
                return(false);
            }
        }