/// <summary>
        /// Reads response elements from XML.
        /// </summary>
        /// <param name="reader">The reader.</param>
        internal override void ReadElementsFromXml(EwsServiceXmlReader reader)
        {
            if (this.ErrorCode == ServiceError.NoError)
            {
                this.delegateUserResponses = new Collection <DelegateUserResponse>();

                reader.Read();

                if (reader.IsStartElement(XmlNamespace.Messages, XmlElementNames.ResponseMessages))
                {
                    int delegateUserIndex = 0;
                    do
                    {
                        reader.Read();

                        if (reader.IsStartElement(XmlNamespace.Messages, XmlElementNames.DelegateUserResponseMessageType))
                        {
                            DelegateUser delegateUser = null;
                            if (this.readDelegateUsers && (this.delegateUsers != null))
                            {
                                delegateUser = this.delegateUsers[delegateUserIndex];
                            }

                            DelegateUserResponse delegateUserResponse = new DelegateUserResponse(readDelegateUsers, delegateUser);

                            delegateUserResponse.LoadFromXml(reader, XmlElementNames.DelegateUserResponseMessageType);

                            this.delegateUserResponses.Add(delegateUserResponse);

                            delegateUserIndex++;
                        }
                    }while (!reader.IsEndElement(XmlNamespace.Messages, XmlElementNames.ResponseMessages));
                }
            }
        }
        /// <summary>
        /// Reads response elements from XML.
        /// </summary>
        /// <param name="reader">The reader.</param>
        internal override void ReadElementsFromXml(EwsServiceXmlReader reader)
        {
            if (this.ErrorCode == ServiceError.NoError)
            {
                this.delegateUserResponses = new Collection<DelegateUserResponse>();

                reader.Read();

                if (reader.IsStartElement(XmlNamespace.Messages, XmlElementNames.ResponseMessages))
                {
                    int delegateUserIndex = 0;
                    do
                    {
                        reader.Read();

                        if (reader.IsStartElement(XmlNamespace.Messages, XmlElementNames.DelegateUserResponseMessageType))
                        {
                            DelegateUser delegateUser = null;
                            if (this.readDelegateUsers && (this.delegateUsers != null))
                            {
                                delegateUser = this.delegateUsers[delegateUserIndex];
                            }

                            DelegateUserResponse delegateUserResponse = new DelegateUserResponse(readDelegateUsers, delegateUser);

                            delegateUserResponse.LoadFromXml(reader, XmlElementNames.DelegateUserResponseMessageType);

                            this.delegateUserResponses.Add(delegateUserResponse);

                            delegateUserIndex++;
                        }
                    }
                    while (!reader.IsEndElement(XmlNamespace.Messages, XmlElementNames.ResponseMessages));
                }
            }
        }
Example #3
0
 public XEwsDelegate(DelegateUserResponse delegateResponse)
 {
     this.DelegateUserId = delegateResponse.DelegateUser.UserId.PrimarySmtpAddress;
     this.ReceivesCopyOfMeeting = delegateResponse.DelegateUser.ReceiveCopiesOfMeetingMessages;
     this.ViewPrivateItems = delegateResponse.DelegateUser.ViewPrivateItems;
     this.CalendarFolderPermission = delegateResponse.DelegateUser.Permissions.CalendarFolderPermissionLevel;
     this.InboxFolderPermission = delegateResponse.DelegateUser.Permissions.InboxFolderPermissionLevel;
     this.ContactFolderPermission = delegateResponse.DelegateUser.Permissions.ContactsFolderPermissionLevel;
     this.TaskFolderPermission = delegateResponse.DelegateUser.Permissions.TasksFolderPermissionLevel;
 }