bool TryReadElementFromXml(EwsServiceXmlReader reader)
    {
        switch (reader.ReadAttributeValue("xsi:type"))
        {
        case XmlElementNames.StringInsightValue:
            this.Item = new StringInsightValue();
            this.Item.LoadFromXml(reader, reader.LocalName);
            break;

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

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

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

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

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

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

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

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

        case XmlElementNames.OutOfOfficeInsightValue:
            this.Item = new OutOfOfficeInsightValue();
            this.Item.LoadFromXml(reader, reader.LocalName);
            break;

        default:
            return(false);
        }

        return(true);
    }
Exemplo n.º 2
0
    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);
    }
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));
    }