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


C# EwsServiceXmlReader.IsEndElement方法代码示例

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


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

示例1: ReadElementsFromXml

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

            base.ReadElementsFromXml(reader);

            reader.ReadStartElement(XmlNamespace.Messages, XmlElementNames.SearchableMailboxes);
            if (!reader.IsEmptyElement)
            {
                do
                {
                    reader.Read();
                    if (reader.IsStartElement(XmlNamespace.Types, XmlElementNames.SearchableMailbox))
                    {
                        this.searchableMailboxes.Add(SearchableMailbox.LoadFromXml(reader));
                    }
                }
                while (!reader.IsEndElement(XmlNamespace.Messages, XmlElementNames.SearchableMailboxes));
            }

            reader.Read();
            if (reader.IsStartElement(XmlNamespace.Messages, XmlElementNames.FailedMailboxes))
            {
                this.FailedMailboxes = FailedSearchMailbox.LoadFailedMailboxesXml(XmlNamespace.Messages, reader);
            }
        }
开发者ID:liliankasem,项目名称:ProjectSpikeAPI,代码行数:30,代码来源:GetSearchableMailboxesResponse.cs

示例2: 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

示例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)
        {
            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

示例4: TryReadElementFromXml

        /// <summary>
        /// Tries to read element from XML.
        /// </summary>
        /// <param name="reader">The reader.</param>
        /// <returns>True if appropriate element was read.</returns>
        internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)
        {
            switch (reader.LocalName)
            {
                case XmlElementNames.TimeZone:
                    LegacyAvailabilityTimeZone legacyTimeZone = new LegacyAvailabilityTimeZone();
                    legacyTimeZone.LoadFromXml(reader, reader.LocalName);

                    this.timeZone = legacyTimeZone.ToTimeZoneInfo();
                    
                    return true;
                case XmlElementNames.WorkingPeriodArray:
                    List<WorkingPeriod> workingPeriods = new List<WorkingPeriod>();

                    do
                    {
                        reader.Read();

                        if (reader.IsStartElement(XmlNamespace.Types, XmlElementNames.WorkingPeriod))
                        {
                            WorkingPeriod workingPeriod = new WorkingPeriod();

                            workingPeriod.LoadFromXml(reader, reader.LocalName);

                            workingPeriods.Add(workingPeriod);
                        }
                    }
                    while (!reader.IsEndElement(XmlNamespace.Types, XmlElementNames.WorkingPeriodArray));

                    // Availability supports a structure that can technically represent different working
                    // times for each day of the week. This is apparently how the information is stored in
                    // Exchange. However, no client (Outlook, OWA) either will let you specify different
                    // working times for each day of the week, and Outlook won't either honor that complex
                    // structure if it happens to be in Exchange.
                    // So here we'll do what Outlook and OWA do: we'll use the start and end times of the
                    // first working period, but we'll use the week days of all the periods.
                    this.startTime = workingPeriods[0].StartTime;
                    this.endTime = workingPeriods[0].EndTime;

                    foreach (WorkingPeriod workingPeriod in workingPeriods)
                    {
                        foreach (DayOfTheWeek dayOfWeek in workingPeriods[0].DaysOfWeek)
                        {
                            if (!this.daysOfTheWeek.Contains(dayOfWeek))
                            {
                                this.daysOfTheWeek.Add(dayOfWeek);
                            }
                        }
                    }

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

示例5: LoadFromXml

        /// <summary>
        /// Load from xml
        /// </summary>
        /// <param name="reader">The reader</param>
        /// <returns>Non indexable item details result object</returns>
        internal static NonIndexableItemDetailsResult LoadFromXml(EwsServiceXmlReader reader)
        {
            NonIndexableItemDetailsResult nonIndexableItemDetailsResult = new NonIndexableItemDetailsResult();
            reader.ReadStartElement(XmlNamespace.Messages, XmlElementNames.NonIndexableItemDetailsResult);

            do
            {
                reader.Read();

                if (reader.IsStartElement(XmlNamespace.Types, XmlElementNames.Items))
                {
                    List<NonIndexableItem> nonIndexableItems = new List<NonIndexableItem>();
                    if (!reader.IsEmptyElement)
                    {
                        do
                        {
                            reader.Read();
                            NonIndexableItem nonIndexableItem = NonIndexableItem.LoadFromXml(reader);
                            if (nonIndexableItem != null)
                            {
                                nonIndexableItems.Add(nonIndexableItem);
                            }
                        }
                        while (!reader.IsEndElement(XmlNamespace.Types, XmlElementNames.Items));

                        nonIndexableItemDetailsResult.Items = nonIndexableItems.ToArray();
                    }
                }

                if (reader.IsStartElement(XmlNamespace.Types, XmlElementNames.FailedMailboxes))
                {
                    nonIndexableItemDetailsResult.FailedMailboxes = FailedSearchMailbox.LoadFailedMailboxesXml(XmlNamespace.Types, reader);
                }
            }
            while (!reader.IsEndElement(XmlNamespace.Messages, XmlElementNames.NonIndexableItemDetailsResult));

            return nonIndexableItemDetailsResult;
        }
开发者ID:liliankasem,项目名称:ProjectSpikeAPI,代码行数:43,代码来源:NonIndexableItemDetailsResult.cs

示例6: LoadSuggestedDaysFromXml

        /// <summary>
        /// Loads the suggested days from XML.
        /// </summary>
        /// <param name="reader">The reader.</param>
        internal void LoadSuggestedDaysFromXml(EwsServiceXmlReader reader)
        {
            reader.ReadStartElement(XmlNamespace.Messages, XmlElementNames.SuggestionDayResultArray);

            do
            {
                reader.Read();

                if (reader.IsStartElement(XmlNamespace.Types, XmlElementNames.SuggestionDayResult))
                {
                    Suggestion daySuggestion = new Suggestion();

                    daySuggestion.LoadFromXml(reader, reader.LocalName);

                    this.daySuggestions.Add(daySuggestion);
                }
            }
            while (!reader.IsEndElement(XmlNamespace.Messages, XmlElementNames.SuggestionDayResultArray));
        }
开发者ID:Pravinmprajapati,项目名称:ews-managed-api,代码行数:23,代码来源:SuggestionsResponse.cs

示例7: ReadElementsFromXml

        /// <summary>
        /// Reads response elements from XML.
        /// </summary>
        /// <param name="reader">The reader.</param>
        internal override void ReadElementsFromXml(EwsServiceXmlReader reader)
        {
            reader.ReadStartElement(XmlNamespace.Messages, XmlElementNames.RootFolder);

            this.results.TotalCount = reader.ReadAttributeValue<int>(XmlAttributeNames.TotalItemsInView);
            this.results.MoreAvailable = !reader.ReadAttributeValue<bool>(XmlAttributeNames.IncludesLastItemInRange);

            // Ignore IndexedPagingOffset attribute if MoreAvailable is false.
            this.results.NextPageOffset = results.MoreAvailable ? reader.ReadNullableAttributeValue<int>(XmlAttributeNames.IndexedPagingOffset) : null;

            reader.ReadStartElement(XmlNamespace.Types, XmlElementNames.Folders);
            if (!reader.IsEmptyElement)
            {
                do
                {
                    reader.Read();

                    if (reader.NodeType == XmlNodeType.Element)
                    {
                        Folder folder = EwsUtilities.CreateEwsObjectFromXmlElementName<Folder>(reader.Service, reader.LocalName);

                        if (folder == null)
                        {
                            reader.SkipCurrentElement();
                        }
                        else
                        {
                            folder.LoadFromXml(
                                        reader,
                                        true, /* clearPropertyBag */
                                        this.propertySet,
                                        true  /* summaryPropertiesOnly */);

                            this.results.Folders.Add(folder);
                        }
                    }
                }
                while (!reader.IsEndElement(XmlNamespace.Types, XmlElementNames.Folders));
            }

            reader.ReadEndElement(XmlNamespace.Messages, XmlElementNames.RootFolder);
        }
开发者ID:liliankasem,项目名称:ProjectSpikeAPI,代码行数:46,代码来源:FindFolderResponse.cs

示例8: ReadElementsFromXml

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

            base.ReadElementsFromXml(reader);

            reader.ReadStartElement(XmlNamespace.Messages, XmlElementNames.DiscoverySearchConfigurations);
            if (!reader.IsEmptyElement)
            {
                do
                {
                    reader.Read();
                    if (reader.IsStartElement(XmlNamespace.Types, XmlElementNames.DiscoverySearchConfiguration))
                    {
                        this.configurations.Add(DiscoverySearchConfiguration.LoadFromXml(reader));
                    }
                }
                while (!reader.IsEndElement(XmlNamespace.Messages, XmlElementNames.DiscoverySearchConfigurations));
            }
            reader.ReadEndElementIfNecessary(XmlNamespace.Messages, XmlElementNames.DiscoverySearchConfigurations);
        }
开发者ID:liliankasem,项目名称:ProjectSpikeAPI,代码行数:25,代码来源:GetDiscoverySearchConfigurationResponse.cs

示例9: ReadElementsFromXml

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

            base.ReadElementsFromXml(reader);

            reader.ReadStartElement(XmlNamespace.Messages, XmlElementNames.RetentionPolicyTags);
            if (!reader.IsEmptyElement)
            {
                do
                {
                    reader.Read();
                    if (reader.IsStartElement(XmlNamespace.Types, XmlElementNames.RetentionPolicyTag))
                    {
                        this.retentionPolicyTags.Add(RetentionPolicyTag.LoadFromXml(reader));
                    }
                }
                while (!reader.IsEndElement(XmlNamespace.Messages, XmlElementNames.RetentionPolicyTags));
                reader.ReadEndElementIfNecessary(XmlNamespace.Messages, XmlElementNames.RetentionPolicyTags);
            }
        }
开发者ID:asine,项目名称:ews-managed-api,代码行数:25,代码来源:GetUserRetentionPolicyTagsResponse.cs

示例10: LoadPropertyValueFromXml

        /// <summary>
        /// Loads from XML.
        /// </summary>
        /// <param name="reader">The reader.</param>
        /// <param name="propertyBag">The property bag.</param>
        internal override sealed void LoadPropertyValueFromXml(EwsServiceXmlReader reader, PropertyBag propertyBag)
        {
            ResponseActions value = ResponseActions.None;

            reader.EnsureCurrentNodeIsStartElement(XmlNamespace.Types, this.XmlElementName);

            if (!reader.IsEmptyElement)
            {
                do
                {
                    reader.Read();

                    if (reader.IsStartElement())
                    {
                        value |= GetResponseAction(reader.LocalName);
                    }
                }
                while (!reader.IsEndElement(XmlNamespace.Types, this.XmlElementName));
            }

            propertyBag[this] = value;
        }
开发者ID:liliankasem,项目名称:ProjectSpikeAPI,代码行数:27,代码来源:ResponseObjectsPropertyDefinition.cs

示例11: 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.TimeZoneDefinitions);

            if (!reader.IsEmptyElement)
            {
                do
                {
                    reader.Read();

                    if (reader.IsStartElement(XmlNamespace.Types, XmlElementNames.TimeZoneDefinition))
                    {
                        TimeZoneDefinition timeZoneDefinition = new TimeZoneDefinition();
                        timeZoneDefinition.LoadFromXml(reader);

                        this.timeZones.Add(timeZoneDefinition.ToTimeZoneInfo(reader.Service));
                    }
                }
                while (!reader.IsEndElement(XmlNamespace.Messages, XmlElementNames.TimeZoneDefinitions));
            }
        }
开发者ID:liliankasem,项目名称:ProjectSpikeAPI,代码行数:27,代码来源:GetServerTimeZonesResponse.cs

示例12: ReadElementsFromXml

        /// <summary>
        /// Read Person from XML.
        /// </summary>
        /// <param name="reader">The reader.</param>
        internal override void ReadElementsFromXml(EwsServiceXmlReader reader)
        {
            EwsUtilities.Assert(
                   this.People != null,
                   "GetPeopleInsightsResponse.ReadElementsFromXml",
                   "People is null.");
            
            reader.ReadStartElement(XmlNamespace.Messages, XmlElementNames.People);
            if (!reader.IsEmptyElement)
            {
                do
                {
                    reader.Read();

                    if (reader.NodeType == XmlNodeType.Element)
                    {
                        Person item = new Person();
                        item.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.Person);
                        this.People.Add(item);
                    }
                }
                while (!reader.IsEndElement(XmlNamespace.Messages, XmlElementNames.People));
            }
        }
开发者ID:Pravinmprajapati,项目名称:ews-managed-api,代码行数:28,代码来源:GetPeopleInsightsResponse.cs

示例13: 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

示例14: ReadItemList

        /// <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));
        }
开发者ID:Pravinmprajapati,项目名称:ews-managed-api,代码行数:80,代码来源:PersonInsight.cs

示例15: LoadExtraErrorDetailsFromXml

        /// <summary>
        /// Loads extra error details from XML
        /// </summary>
        /// <param name="reader">The reader.</param>
        /// <param name="xmlElementName">The current element name of the extra error details.</param>
        /// <returns>
        /// True if the expected extra details is loaded;
        /// False if the element name does not match the expected element.
        /// </returns>
        internal override bool LoadExtraErrorDetailsFromXml(EwsServiceXmlReader reader, string xmlElementName)
        {
            bool baseReturnVal = base.LoadExtraErrorDetailsFromXml(reader, xmlElementName);

            if (reader.IsStartElement(XmlNamespace.Messages, XmlElementNames.ErrorSubscriptionIds))
            {
                do
                {
                    reader.Read();

                    if (reader.NodeType == System.Xml.XmlNodeType.Element &&
                        reader.LocalName == XmlElementNames.SubscriptionId)
                    {
                        this.ErrorSubscriptionIds.Add(
                            reader.ReadElementValue(XmlNamespace.Messages, XmlElementNames.SubscriptionId));
                    }
                }
                while (!reader.IsEndElement(XmlNamespace.Messages, XmlElementNames.ErrorSubscriptionIds));

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


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