本文整理汇总了C#中EwsServiceXmlReader.Read方法的典型用法代码示例。如果您正苦于以下问题:C# EwsServiceXmlReader.Read方法的具体用法?C# EwsServiceXmlReader.Read怎么用?C# EwsServiceXmlReader.Read使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EwsServiceXmlReader
的用法示例。
在下文中一共展示了EwsServiceXmlReader.Read方法的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);
}
}
示例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;
}
示例3: InternalLoadFromXml
/// <summary>
/// Load from XML.
/// </summary>
/// <param name="reader">The reader.</param>
internal override void InternalLoadFromXml(EwsServiceXmlReader reader)
{
base.InternalLoadFromXml(reader);
this.itemId = new ItemId();
this.itemId.LoadFromXml(reader, reader.LocalName);
reader.Read();
this.ParentFolderId = new FolderId();
this.ParentFolderId.LoadFromXml(reader, XmlElementNames.ParentFolderId);
switch (this.EventType)
{
case EventType.Moved:
case EventType.Copied:
reader.Read();
this.oldItemId = new ItemId();
this.oldItemId.LoadFromXml(reader, reader.LocalName);
reader.Read();
this.OldParentFolderId = new FolderId();
this.OldParentFolderId.LoadFromXml(reader, reader.LocalName);
break;
default:
break;
}
}
示例4: 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);
}
}
示例5: 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);
}
}
示例6: 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));
}
示例7: 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();
}
}
示例8: 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);
}
}
示例9: 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.Attachments);
if (!reader.IsEmptyElement)
{
reader.Read(XmlNodeType.Element);
if (this.attachment == null)
{
if (string.Equals(reader.LocalName, XmlElementNames.FileAttachment, StringComparison.OrdinalIgnoreCase))
{
this.attachment = new FileAttachment(reader.Service);
}
else if (string.Equals(reader.LocalName, XmlElementNames.ItemAttachment, StringComparison.OrdinalIgnoreCase))
{
this.attachment = new ItemAttachment(reader.Service);
}
}
if (this.attachment != null)
{
this.attachment.LoadFromXml(reader, reader.LocalName);
}
reader.ReadEndElement(XmlNamespace.Messages, XmlElementNames.Attachments);
}
}
示例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.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;
}
}
示例11: ReadElementsFromXml
/// <summary>
/// Read Personas from XML.
/// </summary>
/// <param name="reader">The reader.</param>
internal override void ReadElementsFromXml(EwsServiceXmlReader reader)
{
EwsUtilities.Assert(
this.Results.Personas != null,
"FindPeopleResponse.ReadElementsFromXml",
"Personas is null.");
reader.ReadStartElement(XmlNamespace.Messages, XmlElementNames.People);
if (!reader.IsEmptyElement)
{
do
{
reader.Read();
if (reader.NodeType == XmlNodeType.Element)
{
Persona item = EwsUtilities.CreateEwsObjectFromXmlElementName<Persona>(reader.Service, reader.LocalName);
if (item == null)
{
reader.SkipCurrentElement();
}
else
{
// Don't clear propertyBag because all properties have been initialized in the persona constructor.
item.LoadFromXml(reader, false, null, false);
this.Results.Personas.Add(item);
}
}
}
while (!reader.IsEndElement(XmlNamespace.Messages, XmlElementNames.People));
}
reader.Read();
if (reader.IsStartElement(XmlNamespace.Messages, XmlElementNames.TotalNumberOfPeopleInView) && !reader.IsEmptyElement)
{
this.Results.TotalCount = reader.ReadElementValue<int>();
reader.Read();
}
if (reader.IsStartElement(XmlNamespace.Messages, XmlElementNames.FirstMatchingRowIndex) && !reader.IsEmptyElement)
{
this.Results.FirstMatchingRowIndex = reader.ReadElementValue<int>();
reader.Read();
}
if (reader.IsStartElement(XmlNamespace.Messages, XmlElementNames.FirstLoadedRowIndex) && !reader.IsEmptyElement)
{
this.Results.FirstLoadedRowIndex = reader.ReadElementValue<int>();
reader.Read();
}
}
示例12: 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;
}
}
示例13: 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.Attachments);
reader.Read(XmlNodeType.Element);
this.attachment.LoadFromXml(reader, reader.LocalName);
reader.ReadEndElement(XmlNamespace.Messages, XmlElementNames.Attachments);
}
示例14: ReadElementsFromXml
/// <summary>
/// Reads response elements from XML.
/// </summary>
/// <param name="reader">The reader.</param>
internal override void ReadElementsFromXml(EwsServiceXmlReader reader)
{
responseCollection = new ServiceResponseCollection<MailTipsResponseMessage>();
base.ReadElementsFromXml(reader);
reader.ReadStartElement(XmlNamespace.Messages, XmlElementNames.ResponseMessages);
if (!reader.IsEmptyElement)
{
// Because we don't have count of returned objects
// test the element to determine if it is return object or EndElement
reader.Read();
while (reader.IsStartElement(XmlNamespace.Messages, XmlElementNames.MailTipsResponseMessageType))
{
MailTipsResponseMessage mrm = new MailTipsResponseMessage();
mrm.LoadFromXml(reader, XmlElementNames.MailTipsResponseMessageType);
this.responseCollection.Add(mrm);
reader.Read();
}
reader.EnsureCurrentNodeIsEndElement(XmlNamespace.Messages, XmlElementNames.ResponseMessages);
}
}
示例15: InternalLoadFromXml
/// <summary>
/// Load from XML.
/// </summary>
/// <param name="reader">The reader.</param>
internal override void InternalLoadFromXml(EwsServiceXmlReader reader)
{
base.InternalLoadFromXml(reader);
this.folderId = new FolderId();
this.folderId.LoadFromXml(reader, reader.LocalName);
reader.Read();
this.ParentFolderId = new FolderId();
this.ParentFolderId.LoadFromXml(reader, XmlElementNames.ParentFolderId);
switch (this.EventType)
{
case EventType.Moved:
case EventType.Copied:
reader.Read();
this.oldFolderId = new FolderId();
this.oldFolderId.LoadFromXml(reader, reader.LocalName);
reader.Read();
this.OldParentFolderId = new FolderId();
this.OldParentFolderId.LoadFromXml(reader, reader.LocalName);
break;
case EventType.Modified:
reader.Read();
if (reader.IsStartElement())
{
reader.EnsureCurrentNodeIsStartElement(XmlNamespace.Types, XmlElementNames.UnreadCount);
this.unreadCount = int.Parse(reader.ReadValue());
}
break;
default:
break;
}
}