Exemplo n.º 1
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)
        {
            do
            {
                reader.Read();
                InsightValue item = null;

                if (reader.NodeType == XmlNodeType.Element && reader.LocalName == XmlElementNames.Item)
                {
                    switch (reader.ReadAttributeValue("xsi:type"))
                    {
                    case XmlElementNames.StringInsightValue:
                        item = new StringInsightValue();
                        item.LoadFromXml(reader, reader.LocalName);
                        this.ItemList.InternalAdd(item);
                        break;

                    case XmlElementNames.ProfileInsightValue:
                        item = new ProfileInsightValue();
                        item.LoadFromXml(reader, reader.LocalName);
                        this.ItemList.InternalAdd(item);
                        break;

                    case XmlElementNames.JobInsightValue:
                        item = new JobInsightValue();
                        item.LoadFromXml(reader, reader.LocalName);
                        this.ItemList.InternalAdd(item);
                        break;

                    case XmlElementNames.UserProfilePicture:
                        item = new UserProfilePicture();
                        item.LoadFromXml(reader, reader.LocalName);
                        this.ItemList.InternalAdd(item);
                        break;

                    case XmlElementNames.EducationInsightValue:
                        item = new EducationInsightValue();
                        item.LoadFromXml(reader, reader.LocalName);
                        this.ItemList.InternalAdd(item);
                        break;

                    case XmlElementNames.SkillInsightValue:
                        item = new SkillInsightValue();
                        item.LoadFromXml(reader, reader.LocalName);
                        this.ItemList.InternalAdd(item);
                        break;

                    default:
                        return(false);
                    }
                }
                else
                {
                    return(false);
                }
            } while (!reader.IsEndElement(XmlNamespace.Messages, XmlElementNames.ItemList));

            return(true);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Tries to read element from XML.
        /// </summary>
        /// <param name="reader">XML reader</param>
        /// <returns>Whether the element was read</returns>
        internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
        {
            switch (reader.LocalName)
            {
            case XmlElementNames.InsightSource:
                this.InsightSource = reader.ReadElementValue <string>();
                break;

            case XmlElementNames.UpdatedUtcTicks:
                this.UpdatedUtcTicks = reader.ReadElementValue <long>();
                break;

            case XmlElementNames.FullName:
                this.fullName = reader.ReadElementValue();
                break;

            case XmlElementNames.FirstName:
                this.firstName = reader.ReadElementValue();
                break;

            case XmlElementNames.LastName:
                this.lastName = reader.ReadElementValue();
                break;

            case XmlElementNames.EmailAddress:
                this.emailAddress = reader.ReadElementValue();
                break;

            case XmlElementNames.Avatar:
                this.avatar = reader.ReadElementValue();
                break;

            case XmlElementNames.JoinedUtcTicks:
                this.joinedUtcTicks = reader.ReadElementValue <long>();
                break;

            case XmlElementNames.ProfilePicture:
                var picture = new UserProfilePicture();
                picture.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.ProfilePicture);
                this.profilePicture = picture;
                break;

            case XmlElementNames.Title:
                this.title = reader.ReadElementValue();
                break;

            default:
                return(false);
            }

            return(true);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Reads ItemList from XML
        /// </summary>
        /// <param name="reader">The reader.</param>
        private void ReadItemList(EwsServiceXmlReader reader)
        {
            do
            {
                reader.Read();
                InsightValue item = null;

                if (reader.NodeType == XmlNodeType.Element && reader.LocalName == XmlElementNames.Item)
                {
                    switch (reader.ReadAttributeValue("xsi:type"))
                    {
                    case XmlElementNames.StringInsightValue:
                        item = new StringInsightValue();
                        item.LoadFromXml(reader, reader.LocalName);
                        this.ItemList.InternalAdd(item);
                        break;

                    case XmlElementNames.ProfileInsightValue:
                        item = new ProfileInsightValue();
                        item.LoadFromXml(reader, reader.LocalName);
                        this.ItemList.InternalAdd(item);
                        break;

                    case XmlElementNames.JobInsightValue:
                        item = new JobInsightValue();
                        item.LoadFromXml(reader, reader.LocalName);
                        this.ItemList.InternalAdd(item);
                        break;

                    case XmlElementNames.UserProfilePicture:
                        item = new UserProfilePicture();
                        item.LoadFromXml(reader, reader.LocalName);
                        this.ItemList.InternalAdd(item);
                        break;

                    case XmlElementNames.EducationInsightValue:
                        item = new EducationInsightValue();
                        item.LoadFromXml(reader, reader.LocalName);
                        this.ItemList.InternalAdd(item);
                        break;

                    case XmlElementNames.SkillInsightValue:
                        item = new SkillInsightValue();
                        item.LoadFromXml(reader, reader.LocalName);
                        this.ItemList.InternalAdd(item);
                        break;

                    case XmlElementNames.ComputedInsightValue:
                        item = new ComputedInsightValue();
                        item.LoadFromXml(reader, reader.LocalName);
                        this.ItemList.InternalAdd(item);
                        break;

                    case XmlElementNames.MeetingInsightValue:
                        item = new MeetingInsightValue();
                        item.LoadFromXml(reader, reader.LocalName);
                        this.ItemList.InternalAdd(item);
                        break;

                    case XmlElementNames.EmailInsightValue:
                        item = new EmailInsightValue();
                        item.LoadFromXml(reader, reader.LocalName);
                        this.ItemList.InternalAdd(item);
                        break;

                    case XmlElementNames.DelveDocument:
                        item = new DelveDocument();
                        item.LoadFromXml(reader, reader.LocalName);
                        this.ItemList.InternalAdd(item);
                        break;

                    case XmlElementNames.CompanyInsightValue:
                        item = new CompanyInsightValue();
                        item.LoadFromXml(reader, reader.LocalName);
                        this.ItemList.InternalAdd(item);
                        break;

                    case XmlElementNames.OutOfOfficeInsightValue:
                        item = new OutOfOfficeInsightValue();
                        item.LoadFromXml(reader, reader.LocalName);
                        this.ItemList.InternalAdd(item);
                        break;
                    }
                }
            }while (!reader.IsEndElement(XmlNamespace.Types, XmlElementNames.ItemList));
        }
        /// <summary>
        /// Tries to read element from XML.
        /// </summary>
        /// <param name="reader">XML reader</param>
        /// <returns>Whether the element was read</returns>
        internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
        {
            switch (reader.LocalName)
            {
                case XmlElementNames.InsightSource:
                    this.InsightSource = reader.ReadElementValue<string>();
                    break;
                case XmlElementNames.UpdatedUtcTicks:
                    this.UpdatedUtcTicks = reader.ReadElementValue<long>();
                    break;
                case XmlElementNames.FullName:
                    this.fullName = reader.ReadElementValue();
                    break;
                case XmlElementNames.FirstName:
                    this.firstName = reader.ReadElementValue();
                    break;
                case XmlElementNames.LastName:
                    this.lastName = reader.ReadElementValue();
                    break;
                case XmlElementNames.EmailAddress:
                    this.emailAddress = reader.ReadElementValue();
                    break;
                case XmlElementNames.Avatar:
                    this.avatar = reader.ReadElementValue();
                    break;
                case XmlElementNames.JoinedUtcTicks:
                    this.joinedUtcTicks = reader.ReadElementValue<long>();
                    break;
                case XmlElementNames.ProfilePicture:
                    var picture = new UserProfilePicture();
                    picture.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.ProfilePicture);
                    this.profilePicture = picture;
                    break;
                case XmlElementNames.Title:
                    this.title = reader.ReadElementValue();
                    break;
                default:
                    return false;
            }

            return true;
        }
        /// <summary>
        /// Reads ItemList from XML
        /// </summary>
        /// <param name="reader">The reader.</param>        
        private void ReadItemList(EwsServiceXmlReader reader)
        {
            do
            {
                reader.Read();
                InsightValue item = null;

                if (reader.NodeType == XmlNodeType.Element && reader.LocalName == XmlElementNames.Item)
                {
                    switch (reader.ReadAttributeValue("xsi:type"))
                    {
                        case XmlElementNames.StringInsightValue:
                            item = new StringInsightValue();
                            item.LoadFromXml(reader, reader.LocalName);
                            this.ItemList.InternalAdd(item);
                            break;
                        case XmlElementNames.ProfileInsightValue:
                            item = new ProfileInsightValue();
                            item.LoadFromXml(reader, reader.LocalName);
                            this.ItemList.InternalAdd(item);
                            break;
                        case XmlElementNames.JobInsightValue:
                            item = new JobInsightValue();
                            item.LoadFromXml(reader, reader.LocalName);
                            this.ItemList.InternalAdd(item);
                            break;
                        case XmlElementNames.UserProfilePicture:
                            item = new UserProfilePicture();
                            item.LoadFromXml(reader, reader.LocalName);
                            this.ItemList.InternalAdd(item);
                            break;
                        case XmlElementNames.EducationInsightValue:
                            item = new EducationInsightValue();
                            item.LoadFromXml(reader, reader.LocalName);
                            this.ItemList.InternalAdd(item);
                            break;
                        case XmlElementNames.SkillInsightValue:
                            item = new SkillInsightValue();
                            item.LoadFromXml(reader, reader.LocalName);
                            this.ItemList.InternalAdd(item);
                            break;
                        case XmlElementNames.ComputedInsightValue:
                            item = new ComputedInsightValue();
                            item.LoadFromXml(reader, reader.LocalName);
                            this.ItemList.InternalAdd(item);
                            break;
                        case XmlElementNames.MeetingInsightValue:
                            item = new MeetingInsightValue();
                            item.LoadFromXml(reader, reader.LocalName);
                            this.ItemList.InternalAdd(item);
                            break;
                        case XmlElementNames.EmailInsightValue:
                            item = new EmailInsightValue();
                            item.LoadFromXml(reader, reader.LocalName);
                            this.ItemList.InternalAdd(item);
                            break;
                        case XmlElementNames.DelveDocument:
                            item = new DelveDocument();
                            item.LoadFromXml(reader, reader.LocalName);
                            this.ItemList.InternalAdd(item);
                            break;
                        case XmlElementNames.CompanyInsightValue:
                            item = new CompanyInsightValue();
                            item.LoadFromXml(reader, reader.LocalName);
                            this.ItemList.InternalAdd(item);
                            break;
                        case XmlElementNames.OutOfOfficeInsightValue:
                            item = new OutOfOfficeInsightValue();
                            item.LoadFromXml(reader, reader.LocalName);
                            this.ItemList.InternalAdd(item);
                            break;
                    }
                }
            } 
            while (!reader.IsEndElement(XmlNamespace.Types, XmlElementNames.ItemList));
        }
        /// <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)
        {
            do
            {
                reader.Read();
                InsightValue item = null;

                if (reader.NodeType == XmlNodeType.Element && reader.LocalName == XmlElementNames.Item)
                {
                    switch (reader.ReadAttributeValue("xsi:type"))
                    {
                        case XmlElementNames.StringInsightValue:
                            item = new StringInsightValue();
                            item.LoadFromXml(reader, reader.LocalName);
                            this.ItemList.InternalAdd(item);
                            break;
                        case XmlElementNames.ProfileInsightValue:
                            item = new ProfileInsightValue();
                            item.LoadFromXml(reader, reader.LocalName);
                            this.ItemList.InternalAdd(item);
                            break;
                        case XmlElementNames.JobInsightValue:
                            item = new JobInsightValue();
                            item.LoadFromXml(reader, reader.LocalName);
                            this.ItemList.InternalAdd(item);
                            break;
                        case XmlElementNames.UserProfilePicture:
                            item = new UserProfilePicture();
                            item.LoadFromXml(reader, reader.LocalName);
                            this.ItemList.InternalAdd(item);
                            break;
                        case XmlElementNames.EducationInsightValue:
                            item = new EducationInsightValue();
                            item.LoadFromXml(reader, reader.LocalName);
                            this.ItemList.InternalAdd(item);
                            break;
                        case XmlElementNames.SkillInsightValue:
                            item = new SkillInsightValue();
                            item.LoadFromXml(reader, reader.LocalName);
                            this.ItemList.InternalAdd(item);
                            break;
                        case XmlElementNames.ComputedInsightValue:
                            item = new ComputedInsightValue();
                            item.LoadFromXml(reader, reader.LocalName);
                            this.ItemList.InternalAdd(item);
                            break;
                        case XmlElementNames.MeetingInsightValue:
                            item = new MeetingInsightValue();
                            item.LoadFromXml(reader, reader.LocalName);
                            this.ItemList.InternalAdd(item);
                            break;
                        case XmlElementNames.EmailInsightValue:
                            item = new EmailInsightValue();
                            item.LoadFromXml(reader, reader.LocalName);
                            this.ItemList.InternalAdd(item);
                            break;
                        case XmlElementNames.DelveDocument:
                            item = new DelveDocument();
                            item.LoadFromXml(reader, reader.LocalName);
                            this.ItemList.InternalAdd(item);
                            break;
                        default:
                            return false;
                    }
                }
                else
                {
                    return false;
                }
            } while (!reader.IsEndElement(XmlNamespace.Messages, XmlElementNames.ItemList));

            return true;
        }