本文整理汇总了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;
}
}
示例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;
}
}
示例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: 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;
}
示例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;
}
}
示例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);
}
示例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));
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
示例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);
}
}
示例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)
{
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;
}
}
}