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


C# EwsServiceXmlReader.IsStartElement方法代码示例

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


在下文中一共展示了EwsServiceXmlReader.IsStartElement方法的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: 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

示例4: LoadFromXml

        /// <summary>
        /// Loads from XML.
        /// </summary>
        /// <param name="reader">The reader.</param>
        internal void LoadFromXml(EwsServiceXmlReader reader)
        {
            reader.ReadStartElement(XmlNamespace.Types, XmlElementNames.Resolution);

            reader.ReadStartElement(XmlNamespace.Types, XmlElementNames.Mailbox);
            this.mailbox.LoadFromXml(reader, XmlElementNames.Mailbox);

            reader.Read();
            if (reader.IsStartElement(XmlNamespace.Types, XmlElementNames.Contact))
            {
                this.contact = new Contact(this.owner.Session);

                // Contacts returned by ResolveNames should behave like Contact.Load with FirstClassPropertySet specified.
                this.contact.LoadFromXml(
                                    reader,
                                    true,                               /* clearPropertyBag */
                                    PropertySet.FirstClassProperties,
                                    false);                             /* summaryPropertiesOnly */

                reader.ReadEndElement(XmlNamespace.Types, XmlElementNames.Resolution);
            }
            else
            {
                reader.EnsureCurrentNodeIsEndElement(XmlNamespace.Types, XmlElementNames.Resolution);
            }
        }
开发者ID:liliankasem,项目名称:ProjectSpikeAPI,代码行数:30,代码来源:NameResolution.cs

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

示例6: ReadElementsFromXml

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

            if (!reader.IsEmptyElement)
            {
                // Because we don't have an element for count of returned object,
                // we have to test the element to determine if it is StartElement of return object or EndElement
                reader.Read();

                while (reader.IsStartElement(XmlNamespace.Types, XmlElementNames.ClientExtension))
                {
                    ClientExtension clientExtension = new ClientExtension();
                    clientExtension.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.ClientExtension);
                    this.ClientExtensions.Add(clientExtension);

                    reader.EnsureCurrentNodeIsEndElement(XmlNamespace.Types, XmlElementNames.ClientExtension);
                    reader.Read();
                }

                reader.EnsureCurrentNodeIsEndElement(XmlNamespace.Messages, XmlElementNames.ClientExtensions);
            }

            reader.Read();
            if (reader.IsStartElement(XmlNamespace.Messages, XmlElementNames.ClientExtensionRawMasterTableXml))
            {
                this.rawMasterTableXml = reader.ReadElementValue();
            }
        }
开发者ID:liliankasem,项目名称:ProjectSpikeAPI,代码行数:36,代码来源:GetClientExtensionResponse.cs

示例7: ReadElementsFromXml

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

            reader.ReadStartElement(XmlNamespace.Messages, XmlElementNames.Rooms);

            if (!reader.IsEmptyElement)
            {
                // Because we don't have an element for count of returned object,
                // we have to test the element to determine if it is StartElement of return object or EndElement
                reader.Read();
                while (reader.IsStartElement(XmlNamespace.Types, XmlElementNames.Room))
                {
                    reader.Read(); // skip the start <Room>

                    EmailAddress emailAddress = new EmailAddress();
                    emailAddress.LoadFromXml(reader, XmlElementNames.RoomId);
                    this.Rooms.Add(emailAddress);

                    reader.ReadEndElement(XmlNamespace.Types, XmlElementNames.Room);
                    reader.Read();
                }

                reader.EnsureCurrentNodeIsEndElement(XmlNamespace.Messages, XmlElementNames.Rooms);
            }
        }
开发者ID:liliankasem,项目名称:ProjectSpikeAPI,代码行数:31,代码来源:GetRoomsResponse.cs

示例8: ReadElementsFromXml

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

            if (this.ErrorCode == ServiceError.NoError && reader.IsStartElement(XmlNamespace.NotSpecified, XmlElementNames.WasFirstInstall))
            {
                this.wasFirstInstall = reader.ReadElementValue<bool>(XmlNamespace.NotSpecified, XmlElementNames.WasFirstInstall);
            }
        }
开发者ID:liliankasem,项目名称:ProjectSpikeAPI,代码行数:13,代码来源:InstallAppResponse.cs

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

示例10: ReadElementsFromXml

 /// <summary>
 /// Reads response elements from XML.
 /// </summary>
 /// <param name="reader">The reader.</param>
 internal override void ReadElementsFromXml(EwsServiceXmlReader reader)
 {
     reader.Read();
     this.ruleCollection.OutlookRuleBlobExists = reader.ReadElementValue<bool>(
         XmlNamespace.Messages, 
         XmlElementNames.OutlookRuleBlobExists);
     reader.Read();
     if (reader.IsStartElement(XmlNamespace.NotSpecified, XmlElementNames.InboxRules))
     {
         this.ruleCollection.LoadFromXml(reader, XmlNamespace.NotSpecified, XmlElementNames.InboxRules);
     }
 }
开发者ID:asine,项目名称:ews-managed-api,代码行数:16,代码来源:GetInboxRulesResponse.cs

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

示例12: ReadElementsFromXml

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

            reader.Read();

            if (reader.IsStartElement(XmlNamespace.Messages, XmlElementNames.MovedItemId))
            {
                this.MovedItemId = new ItemId();
                this.MovedItemId.LoadFromXml(reader, XmlNamespace.Messages, XmlElementNames.MovedItemId);

                reader.ReadEndElementIfNecessary(XmlNamespace.Messages, XmlElementNames.MovedItemId);
            }
        }
开发者ID:liliankasem,项目名称:ProjectSpikeAPI,代码行数:18,代码来源:MarkAsJunkResponse.cs

示例13: ReadElementsFromXml

        /// <summary>
        /// Reads response elements from XML.
        /// </summary>
        /// <param name="reader">The reader.</param>
        internal override void ReadElementsFromXml(EwsServiceXmlReader reader)
        {
            if (this.ErrorCode == ServiceError.NoError)
            {
                this.delegateUserResponses = new Collection<DelegateUserResponse>();

                reader.Read();

                if (reader.IsStartElement(XmlNamespace.Messages, XmlElementNames.ResponseMessages))
                {
                    int delegateUserIndex = 0;
                    do
                    {
                        reader.Read();

                        if (reader.IsStartElement(XmlNamespace.Messages, XmlElementNames.DelegateUserResponseMessageType))
                        {
                            DelegateUser delegateUser = null;
                            if (this.readDelegateUsers && (this.delegateUsers != null))
                            {
                                delegateUser = this.delegateUsers[delegateUserIndex];
                            }

                            DelegateUserResponse delegateUserResponse = new DelegateUserResponse(readDelegateUsers, delegateUser);

                            delegateUserResponse.LoadFromXml(reader, XmlElementNames.DelegateUserResponseMessageType);

                            this.delegateUserResponses.Add(delegateUserResponse);

                            delegateUserIndex++;
                        }
                    }
                    while (!reader.IsEndElement(XmlNamespace.Messages, XmlElementNames.ResponseMessages));
                }
            }
        }
开发者ID:Pravinmprajapati,项目名称:ews-managed-api,代码行数:40,代码来源:DelegateManagementResponse.cs

示例14: 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.Date:
                    // The date that is returned by Availability is unscoped. 
                    DateTime tempDate = DateTime.Parse(reader.ReadElementValue(), CultureInfo.InvariantCulture);

                    if (tempDate.Kind != DateTimeKind.Unspecified)
                    {
                        this.date = new DateTime(tempDate.Ticks, DateTimeKind.Unspecified);
                    }
                    else
                    {
                        this.date = tempDate;
                    }

                    return true;
                case XmlElementNames.DayQuality:
                    this.quality = reader.ReadElementValue<SuggestionQuality>();
                    return true;
                case XmlElementNames.SuggestionArray:
                    if (!reader.IsEmptyElement)
                    {
                        do
                        {
                            reader.Read();

                            if (reader.IsStartElement(XmlNamespace.Types, XmlElementNames.Suggestion))
                            {
                                TimeSuggestion timeSuggestion = new TimeSuggestion();

                                timeSuggestion.LoadFromXml(reader, reader.LocalName);

                                this.timeSuggestions.Add(timeSuggestion);
                            }
                        }
                        while (!reader.IsEndElement(XmlNamespace.Types, XmlElementNames.SuggestionArray));
                    }

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

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


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