예제 #1
0
    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.Id:
            this.Id = reader.ReadElementValue();
            break;

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

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

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

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

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

        case XmlElementNames.Attendees:
            this.Attendees = new ProfileInsightValueCollection(XmlElementNames.Item);
            this.Attendees.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.Attendees);
            break;

        default:
            return(false);
        }

        return(true);
    }
        /// <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<InsightSourceType>();
                    break;
                case XmlElementNames.UpdatedUtcTicks:
                    this.UpdatedUtcTicks = reader.ReadElementValue<long>();
                    break;
                case XmlElementNames.Id:
                    this.Id = reader.ReadElementValue();
                    break;
                case XmlElementNames.Subject:
                    this.Subject = reader.ReadElementValue();
                    break;
                case XmlElementNames.StartUtcTicks:
                    this.StartUtcTicks = reader.ReadElementValue<long>();
                    break;
                case XmlElementNames.EndUtcTicks:
                    this.EndUtcTicks = reader.ReadElementValue<long>();
                    break;
                case XmlElementNames.Location:
                    this.Location = reader.ReadElementValue();
                    break;
                case XmlElementNames.Organizer:
                    this.Organizer = new ProfileInsightValue();
                    this.Organizer.LoadFromXml(reader, reader.LocalName);
                    break;
                case XmlElementNames.Attendees:
                    this.Attendees = new ProfileInsightValueCollection(XmlElementNames.Item);
                    this.Attendees.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.Attendees);
                    break;
                default:
                    return false;
            }

            return true;
        }