当前位置: 首页>>代码示例>>C#>>正文


C# EwsServiceXmlReader.ReadElementValue方法代码示例

本文整理汇总了C#中EwsServiceXmlReader.ReadElementValue方法的典型用法代码示例。如果您正苦于以下问题:C# EwsServiceXmlReader.ReadElementValue方法的具体用法?C# EwsServiceXmlReader.ReadElementValue怎么用?C# EwsServiceXmlReader.ReadElementValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EwsServiceXmlReader的用法示例。


在下文中一共展示了EwsServiceXmlReader.ReadElementValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TryReadElementFromXml

 /// <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.HasLocationChanged:
             this.hasLocationChanged = reader.ReadElementValue<bool>();
             return true;
         case XmlElementNames.Location:
             this.location = reader.ReadElementValue();
             return true;
         case XmlElementNames.HasStartTimeChanged:
             this.hasStartTimeChanged = reader.ReadElementValue<bool>();
             return true;
         case XmlElementNames.Start:
             this.start = reader.ReadElementValueAsDateTime().Value;
             return true;
         case XmlElementNames.HasEndTimeChanged:
             this.hasEndTimeChanged = reader.ReadElementValue<bool>();
             return true;
         case XmlElementNames.End:
             this.end = reader.ReadElementValueAsDateTime().Value;
             return true;
         default:
             return false;
     }
 }
开发者ID:Pravinmprajapati,项目名称:ews-managed-api,代码行数:31,代码来源:ChangeHighlights.cs

示例2: TryReadElementFromXml

        /// <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.InternetMessageId:
                    this.InternetMessageId = reader.ReadElementValue();
                    return true;

                case XmlElementNames.ParentInternetMessageId:
                    this.ParentInternetMessageId = reader.ReadElementValue();
                    return true;

                case XmlElementNames.Items:
                    this.Items = reader.ReadServiceObjectsCollectionFromXml<Item>(
                                        XmlNamespace.Types,
                                        XmlElementNames.Items,
                                        this.GetObjectInstance,
                                        true,               /* clearPropertyBag */
                                        this.propertySet,   /* requestedPropertySet */
                                        false);             /* summaryPropertiesOnly */
                    return true;

                default:
                    return false;
            }
        }
开发者ID:liliankasem,项目名称:ProjectSpikeAPI,代码行数:31,代码来源:ConversationNode.cs

示例3: TryReadElementFromXml

        /// <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 (base.TryReadElementFromXml(reader))
            {
                return true;
            }
            else
            {
                switch (reader.LocalName)
                {
                    case XmlElementNames.TimeOffset:
                        this.timeOffset = EwsUtilities.XSDurationToTimeSpan(reader.ReadElementValue());
                        return true;
                    case XmlElementNames.Month:
                        this.month = reader.ReadElementValue<int>();

                        EwsUtilities.Assert(
                            this.month > 0 && this.month <= 12,
                            "AbsoluteMonthTransition.TryReadElementFromXml",
                            "month is not in the valid 1 - 12 range.");

                        return true;
                    default:
                        return false;
                }
            }
        }
开发者ID:Pravinmprajapati,项目名称:ews-managed-api,代码行数:32,代码来源:AbsoluteMonthTransition.cs

示例4: LoadFromXml

        /// <summary>
        /// Load from xml
        /// </summary>
        /// <param name="reader">The reader</param>
        /// <returns>List of non indexable item statistic object</returns>
        internal static List<NonIndexableItemStatistic> LoadFromXml(EwsServiceXmlReader reader)
        {
            List<NonIndexableItemStatistic> results = new List<NonIndexableItemStatistic>();

            reader.Read();
            if (reader.IsStartElement(XmlNamespace.Messages, XmlElementNames.NonIndexableItemStatistics))
            {
                do
                {
                    reader.Read();
                    if (reader.IsStartElement(XmlNamespace.Types, XmlElementNames.NonIndexableItemStatistic))
                    {
                        string mailbox = reader.ReadElementValue(XmlNamespace.Types, XmlElementNames.Mailbox);
                        int itemCount = reader.ReadElementValue<int>(XmlNamespace.Types, XmlElementNames.ItemCount);
                        string errorMessage = null;
                        if (reader.IsStartElement(XmlNamespace.Types, XmlElementNames.ErrorMessage))
                        {
                            errorMessage = reader.ReadElementValue(XmlNamespace.Types, XmlElementNames.ErrorMessage);
                        }

                        results.Add(new NonIndexableItemStatistic { Mailbox = mailbox, ItemCount = itemCount, ErrorMessage = errorMessage });
                    }
                }
                while (!reader.IsEndElement(XmlNamespace.Messages, XmlElementNames.NonIndexableItemStatistics));
            }

            return results;
        }
开发者ID:asine,项目名称:ews-managed-api,代码行数:33,代码来源:NonIndexableItemStatistic.cs

示例5: ReadElementsFromXml

        /// <summary>
        /// Read Photo results from XML.
        /// </summary>
        /// <param name="reader">The reader.</param>
        internal override void ReadElementsFromXml(EwsServiceXmlReader reader)
        {
            bool hasChanged = reader.ReadElementValue<bool>(XmlNamespace.Messages, XmlElementNames.HasChanged);

            reader.ReadStartElement(XmlNamespace.Messages, XmlElementNames.PictureData);
            byte[] photoData = reader.ReadBase64ElementValue();

            // We only get a content type if we get a photo
            if (photoData.Length > 0)
            {
                this.Results.Photo = photoData;
                this.Results.ContentType = reader.ReadElementValue(XmlNamespace.Messages, XmlElementNames.ContentType);
            }

            if (hasChanged)
            {
                if (this.Results.Photo.Length == 0)
                {
                    this.Results.Status = GetUserPhotoStatus.PhotoOrUserNotFound;
                }
                else
                {
                    this.Results.Status = GetUserPhotoStatus.PhotoReturned;
                }
            }
            else
            {
                this.Results.Status = GetUserPhotoStatus.PhotoUnchanged;
            }
        }
开发者ID:asine,项目名称:ews-managed-api,代码行数:34,代码来源:GetUserPhotoResponse.cs

示例6: ReadElementsFromXml

        /// <summary>
        /// Reads response elements from XML.
        /// </summary>
        /// <param name="reader">The reader.</param>
        internal override void ReadElementsFromXml(EwsServiceXmlReader reader)
        {
            base.ReadElementsFromXml(reader);

            reader.ReadStartElement(XmlNamespace.Messages, XmlElementNames.Token);
            this.Id = reader.ReadElementValue(XmlNamespace.Types, XmlElementNames.Id);
            this.TokenType = (ClientAccessTokenType)Enum.Parse(typeof(ClientAccessTokenType), reader.ReadElementValue(XmlNamespace.Types, XmlElementNames.TokenType));
            this.TokenValue = reader.ReadElementValue(XmlNamespace.Types, XmlElementNames.TokenValue);
            this.TTL = int.Parse(reader.ReadElementValue(XmlNamespace.Types, XmlElementNames.TTL));
            reader.ReadEndElementIfNecessary(XmlNamespace.Messages, XmlElementNames.Token);
        }
开发者ID:Pravinmprajapati,项目名称:ews-managed-api,代码行数:15,代码来源:GetClientAccessTokenResponse.cs

示例7: LoadFreeBusyViewFromXml

        /// <summary>
        /// Loads the free busy view from XML.
        /// </summary>
        /// <param name="reader">The reader.</param>
        /// <param name="viewType">Type of free/busy view.</param>
        internal void LoadFreeBusyViewFromXml(EwsServiceXmlReader reader, FreeBusyViewType viewType)
        {
            reader.ReadStartElement(XmlNamespace.Messages, XmlElementNames.FreeBusyView);

            string viewTypeString = reader.ReadElementValue(XmlNamespace.Types, XmlElementNames.FreeBusyViewType);

            this.viewType = (FreeBusyViewType)Enum.Parse(typeof(FreeBusyViewType), viewTypeString, false);

            do
            {
                reader.Read();

                if (reader.IsStartElement())
                {
                    switch (reader.LocalName)
                    {
                        case XmlElementNames.MergedFreeBusy:
                            string mergedFreeBusy = reader.ReadElementValue();

                            for (int i = 0; i < mergedFreeBusy.Length; i++)
                            {
                                this.mergedFreeBusyStatus.Add((LegacyFreeBusyStatus)Byte.Parse(mergedFreeBusy[i].ToString()));
                            }

                            break;
                        case XmlElementNames.CalendarEventArray:
                            do
                            {
                                reader.Read();

                                if (reader.IsStartElement(XmlNamespace.Types, XmlElementNames.CalendarEvent))
                                {
                                    CalendarEvent calendarEvent = new CalendarEvent();

                                    calendarEvent.LoadFromXml(reader, XmlElementNames.CalendarEvent);

                                    this.calendarEvents.Add(calendarEvent);
                                }
                            }
                            while (!reader.IsEndElement(XmlNamespace.Types, XmlElementNames.CalendarEventArray));

                            break;
                        case XmlElementNames.WorkingHours:
                            this.workingHours = new WorkingHours();
                            this.workingHours.LoadFromXml(reader, reader.LocalName);

                            break;
                    }
                }
            }
            while (!reader.IsEndElement(XmlNamespace.Messages, XmlElementNames.FreeBusyView));
        }
开发者ID:liliankasem,项目名称:ProjectSpikeAPI,代码行数:57,代码来源:AttendeeAvailability.cs

示例8: TryReadElementFromXml

 /// <summary>
 /// Attempts to read the element at the reader's current position.
 /// </summary>
 /// <param name="reader">The reader used to read the element.</param>
 /// <returns>True if the element was read, false otherwise.</returns>
 internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
 {
     switch (reader.LocalName)
     {
         case XmlElementNames.ID:
             this.storeId = reader.ReadElementValue();
             return true;
         case XmlElementNames.Subject:
             this.subject = reader.ReadElementValue();
             return true;
         case XmlElementNames.Location:
             this.location = reader.ReadElementValue();
             return true;
         case XmlElementNames.IsMeeting:
             this.isMeeting = reader.ReadElementValue<bool>();
             return true;
         case XmlElementNames.IsRecurring:
             this.isRecurring = reader.ReadElementValue<bool>();
             return true;
         case XmlElementNames.IsException:
             this.isException = reader.ReadElementValue<bool>();
             return true;
         case XmlElementNames.IsReminderSet:
             this.isReminderSet = reader.ReadElementValue<bool>();
             return true;
         case XmlElementNames.IsPrivate:
             this.isPrivate = reader.ReadElementValue<bool>();
             return true;
         default:
             return false;
     }
 }
开发者ID:liliankasem,项目名称:ProjectSpikeAPI,代码行数:37,代码来源:CalendarEventDetails.cs

示例9: TryReadElementFromXml

 /// <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.VotingOptionDisplayName:
             this.displayName = reader.ReadElementValue<string>();
             return true;
         case XmlElementNames.SendPrompt:
             this.sendPrompt = reader.ReadElementValue<SendPrompt>();
             return true;
         default:
             return false;
     }
 }
开发者ID:liliankasem,项目名称:ProjectSpikeAPI,代码行数:19,代码来源:VotingOptionData.cs

示例10: TryReadElementFromXml

 /// <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.HighlightTermScope:
             this.scope = reader.ReadElementValue();
             return true;
         case XmlElementNames.HighlightTermValue:
             this.value = reader.ReadElementValue();
             return true;
         default:
             return false;
     }
 }
开发者ID:liliankasem,项目名称:ProjectSpikeAPI,代码行数:19,代码来源:HighlightTerm.cs

示例11: TryReadElementFromXml

        /// <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.Key:
                    this.Key = reader.ReadElementValue();
                    break;
                case XmlElementNames.Value:
                    this.Value = reader.ReadElementValue();
                    break;
                default:
                    return false;
            }

            return true;
        }
开发者ID:asine,项目名称:ews-managed-api,代码行数:21,代码来源:ComputedInsightValueProperty.cs

示例12: TryReadElementFromXml

        /// <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.NlgName:
                    this.Name = reader.ReadElementValue();
                    return true;

                case XmlElementNames.NlgUserId:
                    this.UserId = reader.ReadElementValue();
                    return true;

                default:
                    return base.TryReadElementFromXml(reader);
            }
        }
开发者ID:asine,项目名称:ews-managed-api,代码行数:21,代码来源:EmailUserEntity.cs

示例13: TryReadElementFromXml

        /// <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.ExtendedFieldURI:
                    this.propertyDefinition = new ExtendedPropertyDefinition();
                    this.propertyDefinition.LoadFromXml(reader);
                    return true;
                case XmlElementNames.Value:
                    EwsUtilities.Assert(
                        this.PropertyDefinition != null,
                        "ExtendedProperty.TryReadElementFromXml",
                        "PropertyDefintion is missing");

                    string stringValue = reader.ReadElementValue();
                    this.value = MapiTypeConverter.ConvertToValue(this.PropertyDefinition.MapiType, stringValue);
                    return true;
                case XmlElementNames.Values:
                    EwsUtilities.Assert(
                        this.PropertyDefinition != null,
                        "ExtendedProperty.TryReadElementFromXml",
                        "PropertyDefintion is missing");

                    StringList stringList = new StringList(XmlElementNames.Value);
                    stringList.LoadFromXml(reader, reader.LocalName);
                    this.value = MapiTypeConverter.ConvertToValue(this.PropertyDefinition.MapiType, stringList);
                    return true;
                default:
                    return false;
            }
        }
开发者ID:Pravinmprajapati,项目名称:ews-managed-api,代码行数:36,代码来源:ExtendedProperty.cs

示例14: TryReadElementFromXml

        /// <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.UserOptions:
                    if (!reader.IsEmptyElement)
                    {
                        do
                        {
                            reader.Read();

                            if (reader.IsStartElement(XmlNamespace.Types, XmlElementNames.VotingOptionData))
                            {
                                VotingOptionData option = new VotingOptionData();
                                option.LoadFromXml(reader, reader.LocalName);
                                this.userOptions.Add(option);
                            }
                        }
                        while (!reader.IsEndElement(XmlNamespace.Types, XmlElementNames.UserOptions));
                    }
                    return true;
                case XmlElementNames.VotingResponse:
                    this.votingResponse = reader.ReadElementValue<string>();
                    return true;
                default:
                    return false;
            }
        }
开发者ID:Pravinmprajapati,项目名称:ews-managed-api,代码行数:33,代码来源:VotingInformation.cs

示例15: TryReadElementFromXml

        /// <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 (base.TryReadElementFromXml(reader))
            {
                return true;
            }
            else
            {
                if (reader.LocalName == XmlElementNames.Day)
                {
                    this.dayOfMonth = reader.ReadElementValue<int>();

                    EwsUtilities.Assert(
                        this.dayOfMonth > 0 && this.dayOfMonth <= 31,
                        "AbsoluteDayOfMonthTransition.TryReadElementFromXml",
                        "dayOfMonth is not in the valid 1 - 31 range.");

                    return true;
                }
                else
                {
                    return false;
                }
            }
        }
开发者ID:Pravinmprajapati,项目名称:ews-managed-api,代码行数:30,代码来源:AbsoluteDayOfMonthTransition.cs


注:本文中的EwsServiceXmlReader.ReadElementValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。