本文整理汇总了C#中EwsServiceXmlReader.ReadAttributeValue方法的典型用法代码示例。如果您正苦于以下问题:C# EwsServiceXmlReader.ReadAttributeValue方法的具体用法?C# EwsServiceXmlReader.ReadAttributeValue怎么用?C# EwsServiceXmlReader.ReadAttributeValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EwsServiceXmlReader
的用法示例。
在下文中一共展示了EwsServiceXmlReader.ReadAttributeValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadAttributesFromXml
/// <summary>
/// Reads attributes from XML.
/// </summary>
/// <param name="reader">The reader.</param>
internal override void ReadAttributesFromXml(EwsServiceXmlReader reader)
{
this.bodyType = reader.ReadAttributeValue<BodyType>(XmlAttributeNames.BodyType);
string attributeValue = reader.ReadAttributeValue(XmlAttributeNames.IsTruncated);
if (!string.IsNullOrEmpty(attributeValue))
{
this.isTruncated = bool.Parse(attributeValue);
}
}
示例2: Parse
/// <summary>
/// Parse current element to extract server information
/// </summary>
/// <param name="reader">EwsServiceXmlReader</param>
/// <returns>ExchangeServerInfo</returns>
internal static ExchangeServerInfo Parse(EwsServiceXmlReader reader)
{
EwsUtilities.Assert(
reader.HasAttributes,
"ExchangeServerVersion.Parse",
"Current element doesn't have attributes");
ExchangeServerInfo info = new ExchangeServerInfo();
info.MajorVersion = reader.ReadAttributeValue<int>("MajorVersion");
info.MinorVersion = reader.ReadAttributeValue<int>("MinorVersion");
info.MajorBuildNumber = reader.ReadAttributeValue<int>("MajorBuildNumber");
info.MinorBuildNumber = reader.ReadAttributeValue<int>("MinorBuildNumber");
info.VersionString = reader.ReadAttributeValue("Version");
return info;
}
示例3: 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);
}
示例4: TryLoadFromXml
/// <summary>
/// Tries to load from XML.
/// </summary>
/// <param name="reader">The reader.</param>
/// <param name="propertyDefinition">The property definition.</param>
/// <returns>True if property was loaded.</returns>
internal static bool TryLoadFromXml(EwsServiceXmlReader reader, ref PropertyDefinitionBase propertyDefinition)
{
switch (reader.LocalName)
{
case XmlElementNames.FieldURI:
propertyDefinition = ServiceObjectSchema.FindPropertyDefinition(reader.ReadAttributeValue(XmlAttributeNames.FieldURI));
reader.SkipCurrentElement();
return true;
case XmlElementNames.IndexedFieldURI:
propertyDefinition = new IndexedPropertyDefinition(
reader.ReadAttributeValue(XmlAttributeNames.FieldURI),
reader.ReadAttributeValue(XmlAttributeNames.FieldIndex));
reader.SkipCurrentElement();
return true;
case XmlElementNames.ExtendedFieldURI:
propertyDefinition = new ExtendedPropertyDefinition();
(propertyDefinition as ExtendedPropertyDefinition).LoadFromXml(reader);
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)
{
base.ReadElementsFromXml(reader);
reader.ReadStartElement(XmlNamespace.Messages, XmlElementNames.RootItemId);
string changeKey = reader.ReadAttributeValue(XmlAttributeNames.RootItemChangeKey);
if (!string.IsNullOrEmpty(changeKey) && this.attachment.Owner != null)
{
this.attachment.Owner.RootItemId.ChangeKey = changeKey;
}
reader.ReadEndElementIfNecessary(XmlNamespace.Messages, XmlElementNames.RootItemId);
}
示例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.ReadAttributeValue("xsi:type"))
{
case XmlElementNames.StringInsightValue:
this.Item = new StringInsightValue();
this.Item.LoadFromXml(reader, reader.LocalName);
break;
case XmlElementNames.ProfileInsightValue:
this.Item = new ProfileInsightValue();
this.Item.LoadFromXml(reader, reader.LocalName);
break;
case XmlElementNames.JobInsightValue:
this.Item = new JobInsightValue();
this.Item.LoadFromXml(reader, reader.LocalName);
break;
case XmlElementNames.UserProfilePicture:
this.Item = new UserProfilePicture();
this.Item.LoadFromXml(reader, reader.LocalName);
break;
case XmlElementNames.EducationInsightValue:
this.Item = new EducationInsightValue();
this.Item.LoadFromXml(reader, reader.LocalName);
break;
case XmlElementNames.SkillInsightValue:
this.Item = new SkillInsightValue();
this.Item.LoadFromXml(reader, reader.LocalName);
break;
case XmlElementNames.DelveDocument:
this.Item = new DelveDocument();
this.Item.LoadFromXml(reader, reader.LocalName);
break;
case XmlElementNames.CompanyInsightValue:
this.Item = new CompanyInsightValue();
this.Item.LoadFromXml(reader, reader.LocalName);
break;
case XmlElementNames.ComputedInsightValue:
this.Item = new ComputedInsightValue();
this.Item.LoadFromXml(reader, reader.LocalName);
break;
case XmlElementNames.OutOfOfficeInsightValue:
this.Item = new OutOfOfficeInsightValue();
this.Item.LoadFromXml(reader, reader.LocalName);
break;
default:
return false;
}
return true;
}
示例7: 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.AlternateId);
string alternateIdClass = reader.ReadAttributeValue(XmlNamespace.XmlSchemaInstance, XmlAttributeNames.Type);
int aliasSeparatorIndex = alternateIdClass.IndexOf(':');
if (aliasSeparatorIndex > -1)
{
alternateIdClass = alternateIdClass.Substring(aliasSeparatorIndex + 1);
}
// Alternate Id classes are responsible fro reading the AlternateId end element when necessary
switch (alternateIdClass)
{
case AlternateId.SchemaTypeName:
this.convertedId = new AlternateId();
break;
case AlternatePublicFolderId.SchemaTypeName:
this.convertedId = new AlternatePublicFolderId();
break;
case AlternatePublicFolderItemId.SchemaTypeName:
this.convertedId = new AlternatePublicFolderItemId();
break;
default:
EwsUtilities.Assert(
false,
"ConvertIdResponse.ReadElementsFromXml",
string.Format("Unknown alternate Id class: {0}", alternateIdClass));
break;
}
this.convertedId.LoadAttributesFromXml(reader);
reader.ReadEndElementIfNecessary(XmlNamespace.Messages, XmlElementNames.AlternateId);
}
示例8: 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)
{
while (true)
{
switch (reader.LocalName)
{
case XmlElementNames.InsightType:
this.InsightType = reader.ReadElementValue<string>();
break;
case XmlElementNames.Rank:
this.Rank = reader.ReadElementValue<double>();
break;
case XmlElementNames.Content:
var type = reader.ReadAttributeValue("xsi:type");
switch (type)
{
case XmlElementNames.SingleValueInsightContent:
this.Content = new SingleValueInsightContent();
((SingleValueInsightContent)this.Content).LoadFromXml(reader, reader.LocalName);
break;
case XmlElementNames.MultiValueInsightContent:
this.Content = new MultiValueInsightContent();
((MultiValueInsightContent)this.Content).LoadFromXml(reader, reader.LocalName);
break;
default:
return false;
}
break;
case XmlElementNames.ItemList:
this.ReadItemList(reader);
break;
default:
return false;
}
return true;
}
}
示例9: ReadAttributesFromXml
/// <summary>
/// Reads the member Key attribute from XML.
/// </summary>
/// <param name="reader">The reader.</param>
internal override void ReadAttributesFromXml(EwsServiceXmlReader reader)
{
this.key = reader.ReadAttributeValue<string>(XmlAttributeNames.Key);
}
示例10: ReadAttributesFromXml
/// <summary>
/// Reads attributes from XML.
/// </summary>
/// <param name="reader">The reader.</param>
internal override void ReadAttributesFromXml(EwsServiceXmlReader reader)
{
this.uniqueId = reader.ReadAttributeValue(XmlAttributeNames.Id);
this.changeKey = reader.ReadAttributeValue(XmlAttributeNames.ChangeKey);
}
示例11: LoadAttributesFromXml
/// <summary>
/// Loads the attributes from XML.
/// </summary>
/// <param name="reader">The reader.</param>
internal override void LoadAttributesFromXml(EwsServiceXmlReader reader)
{
base.LoadAttributesFromXml(reader);
this.FolderId = reader.ReadAttributeValue(XmlAttributeNames.FolderId);
}
示例12: ReadAttributesFromXml
/// <summary>
/// Reads the attributes from XML.
/// </summary>
/// <param name="reader">The reader.</param>
internal override void ReadAttributesFromXml(EwsServiceXmlReader reader)
{
this.name = reader.ReadAttributeValue(XmlAttributeNames.Name);
this.id = reader.ReadAttributeValue(XmlAttributeNames.Id);
// EWS can return a TimeZone definition with no Id. Generate a new Id in this case.
if (string.IsNullOrEmpty(this.id))
{
string nameValue = string.IsNullOrEmpty(this.Name) ? string.Empty : this.Name;
this.Id = NoIdPrefix + Math.Abs(nameValue.GetHashCode()).ToString();
}
}
示例13: ReadAttributesFromXml
/// <summary>
/// Reads attributes from XML.
/// This should always be UTF-8 for MimeContentUTF8
/// </summary>
/// <param name="reader">The reader.</param>
internal override void ReadAttributesFromXml(EwsServiceXmlReader reader)
{
this.characterSet = reader.ReadAttributeValue<string>(XmlAttributeNames.CharacterSet);
}
示例14: LoadFromXml
/// <summary>
/// Loads from XML.
/// </summary>
/// <param name="reader">The reader.</param>
/// <param name="xmlElementName">Name of the XML element.</param>
internal void LoadFromXml(EwsServiceXmlReader reader, string xmlElementName)
{
reader.EnsureCurrentNodeIsStartElement(XmlNamespace.Types, xmlElementName);
if (reader.HasAttributes)
{
this.culture = reader.ReadAttributeValue("xml:lang");
}
this.message = reader.ReadElementValue(XmlNamespace.Types, XmlElementNames.Message);
reader.ReadEndElement(XmlNamespace.Types, xmlElementName);
}
示例15: ReadAttributesFromXml
/// <summary>
/// Reads the attributes from XML.
/// </summary>
/// <param name="reader">The reader.</param>
internal override void ReadAttributesFromXml(EwsServiceXmlReader reader)
{
this.Traversal = reader.ReadAttributeValue<SearchFolderTraversal>(XmlAttributeNames.Traversal);
}