本文整理汇总了C#中EwsServiceXmlReader类的典型用法代码示例。如果您正苦于以下问题:C# EwsServiceXmlReader类的具体用法?C# EwsServiceXmlReader怎么用?C# EwsServiceXmlReader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EwsServiceXmlReader类属于命名空间,在下文中一共展示了EwsServiceXmlReader类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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();
}
}
示例2: 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)
{
MeetingTimeZone meetingTimeZone = new MeetingTimeZone();
meetingTimeZone.LoadFromXml(reader, this.XmlElementName);
propertyBag[AppointmentSchema.StartTimeZone] = meetingTimeZone.ToTimeZoneInfo();
}
示例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;
}
}
}
示例4: 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;
}
}
示例5: 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);
}
}
示例6: 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;
}
}
示例7: 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.OofState:
this.state = reader.ReadValue<OofState>();
return true;
case XmlElementNames.ExternalAudience:
this.externalAudience = reader.ReadValue<OofExternalAudience>();
return true;
case XmlElementNames.Duration:
this.duration = new TimeWindow();
this.duration.LoadFromXml(reader);
return true;
case XmlElementNames.InternalReply:
this.internalReply = new OofReply();
this.internalReply.LoadFromXml(reader, reader.LocalName);
return true;
case XmlElementNames.ExternalReply:
this.externalReply = new OofReply();
this.externalReply.LoadFromXml(reader, reader.LocalName);
return true;
default:
return false;
}
}
示例8: 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;
}
}
示例9: LoadPropertyValueFromXml
/// <summary>
/// Loads from XML.
/// </summary>
/// <param name="reader">The reader.</param>
/// <param name="propertyBag">The property bag.</param>
internal override void LoadPropertyValueFromXml(EwsServiceXmlReader reader, PropertyBag propertyBag)
{
TimeZoneDefinition timeZoneDefinition = new TimeZoneDefinition();
timeZoneDefinition.LoadFromXml(reader, this.XmlElementName);
propertyBag[this] = timeZoneDefinition.ToTimeZoneInfo(reader.Service);
}
示例10: 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);
}
}
示例11: 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.NlgAttendees:
this.Attendees = new EmailUserEntityCollection();
this.Attendees.LoadFromXml(reader, XmlNamespace.Types, XmlElementNames.NlgAttendees);
return true;
case XmlElementNames.NlgLocation:
this.Location = reader.ReadElementValue();
return true;
case XmlElementNames.NlgSubject:
this.Subject = reader.ReadElementValue();
return true;
case XmlElementNames.NlgMeetingString:
this.MeetingString = reader.ReadElementValue();
return true;
case XmlElementNames.NlgStartTime:
this.StartTime = reader.ReadElementValueAsDateTime();
return true;
case XmlElementNames.NlgEndTime:
this.EndTime = reader.ReadElementValueAsDateTime();
return true;
default:
return base.TryReadElementFromXml(reader);
}
}
示例12: 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;
}
}
示例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;
}
}
示例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;
}
}
示例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)
{
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;
}
}