本文整理汇总了C#中System.Xml.XmlReader.ReadElementContentAsUrn方法的典型用法代码示例。如果您正苦于以下问题:C# XmlReader.ReadElementContentAsUrn方法的具体用法?C# XmlReader.ReadElementContentAsUrn怎么用?C# XmlReader.ReadElementContentAsUrn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.XmlReader
的用法示例。
在下文中一共展示了XmlReader.ReadElementContentAsUrn方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParseXml
internal static WindowsPhoneStoreServiceAppImageNode ParseXml(XmlReader reader)
{
var node = new WindowsPhoneStoreServiceAppImageNode();
if (reader.IsEmptyElement)
{
reader.Skip();
}
else
{
reader.ReadStartElement();
while (reader.NodeType != XmlNodeType.EndElement)
{
switch (reader.LocalName)
{
case "id":
node.Id = reader.ReadElementContentAsUrn();
break;
case "orientation":
node.Orientation = reader.ReadElementContentAsInt();
break;
default:
reader.Skip();
break;
}
}
reader.ReadEndElement();
}
return node;
}
示例2: ParseXml
internal static MarketplaceAppImageNode ParseXml(XmlReader reader)
{
var node = new MarketplaceAppImageNode();
reader.ReadStartElement();
while (reader.NodeType != XmlNodeType.EndElement)
{
switch (reader.LocalName)
{
case "id":
node.Id = reader.ReadElementContentAsUrn();
break;
case "orientation":
node.Orientation = reader.ReadElementContentAsInt();
break;
default:
reader.Skip();
break;
}
}
reader.ReadEndElement();
return node;
}
示例3: ParseXml
internal static WindowsPhoneStoreServiceAppCategoryNode ParseXml(XmlReader reader)
{
var node = new WindowsPhoneStoreServiceAppCategoryNode();
if (reader.IsEmptyElement)
{
reader.Skip();
}
else
{
reader.ReadStartElement();
while (reader.NodeType != XmlNodeType.EndElement)
{
switch (reader.LocalName)
{
case "id":
node.Id = reader.ReadElementContentAsUrn();
break;
case "title":
node.Title = reader.ReadElementContentAsString();
break;
case "isRoot":
node.IsRoot = string.Equals(reader.ReadElementContentAsString(), bool.TrueString, StringComparison.OrdinalIgnoreCase);
break;
case "parentId":
node.ParentId = reader.ReadElementContentAsString();
break;
default:
reader.Skip();
break;
}
}
reader.ReadEndElement();
}
return node;
}
示例4: ParseXml
internal static MarketplaceAppCategoryNode ParseXml(XmlReader reader)
{
var node = new MarketplaceAppCategoryNode();
reader.ReadStartElement();
while (reader.NodeType != XmlNodeType.EndElement)
{
switch (reader.LocalName)
{
case "id":
node.Id = reader.ReadElementContentAsUrn();
break;
case "title":
node.Title = reader.ReadElementContentAsString();
break;
case "isRoot":
node.IsRoot = string.Equals(reader.ReadElementContentAsString(), bool.TrueString, StringComparison.InvariantCultureIgnoreCase);
break;
case "parentId":
node.ParentId = reader.ReadElementContentAsString();
break;
default:
reader.Skip();
break;
}
}
reader.ReadEndElement();
return node;
}
示例5: ParseXml
internal static MarketplaceAppOfferNode ParseXml(XmlReader reader)
{
var node = new MarketplaceAppOfferNode();
reader.ReadStartElement();
while (reader.NodeType != XmlNodeType.EndElement)
{
switch (reader.LocalName)
{
case "offerId":
node.OfferId = reader.ReadElementContentAsUrn();
break;
case "mediaInstanceId":
node.MediaInstanceId = reader.ReadElementContentAsUrn();
break;
case "clientTypes":
node.ClientTypes = reader.ReadElementContentAsArray(x => x.ReadElementContentAsString());
break;
case "paymentTypes":
node.PaymentTypes = reader.ReadElementContentAsArray(x => x.ReadElementContentAsString());
break;
case "store":
node.Store = reader.ReadElementContentAsString();
break;
case "price":
node.Price = reader.ReadElementContentAsDouble();
break;
case "displayPrice":
node.DisplayPrice = reader.ReadElementContentAsString();
break;
case "priceCurrencyCode":
node.PriceCurrencyCode = reader.ReadElementContentAsString();
break;
case "licenseRight":
node.LicenseRight = reader.ReadElementContentAsString();
break;
case "expiration":
node.Expiration = reader.ReadElementContentAsDateTime();
break;
default:
reader.Skip();
break;
}
}
reader.ReadEndElement();
return node;
}
示例6: ParseXml
internal static MarketplaceAppNode ParseXml(XmlReader reader)
{
var node = new MarketplaceAppNode();
reader.ReadStartElement();
while (reader.NodeType != XmlNodeType.EndElement)
{
switch (reader.Name)
{
case "a:updated":
node.Updated = reader.ReadElementContentAsDateTime();
break;
case "a:title":
node.Title = reader.ReadElementContentAsString();
break;
case "a:id":
node.Id = reader.ReadElementContentAsUrn();
break;
case "a:content":
node.Content = MarketplaceAppContentNode.ParseXml(reader);
break;
case "iapCount":
node.IapCount = reader.ReadElementContentAsInt();
break;
case "sortTitle":
node.SortTitle = reader.ReadElementContentAsString();
break;
case "releaseDate":
node.ReleaseDate = reader.ReadElementContentAsDateTime();
break;
case "visibilityStatus":
node.VisibilityStatus = reader.ReadElementContentAsString();
break;
case "publisher":
node.Publisher = reader.ReadElementContentAsString();
break;
case "averageUserRating":
node.AverageUserRating = reader.ReadElementContentAsDouble();
break;
case "userRatingCount":
node.UserRatingCount = reader.ReadElementContentAsInt();
break;
case "image":
node.Image = MarketplaceAppImageNode.ParseXml(reader);
break;
case "screenshots":
node.Screenshots = reader.ReadElementContentAsArray(MarketplaceAppImageNode.ParseXml);
break;
case "categories":
node.Categories = reader.ReadElementContentAsArray(MarketplaceAppCategoryNode.ParseXml);
break;
case "tags":
node.Tags = reader.ReadElementContentAsArray(x => x.ReadElementContentAsString());
break;
case "taxString":
node.TaxString = reader.ReadElementContentAsString();
break;
case "backgroundImage":
node.BackgroundImage = MarketplaceAppImageNode.ParseXml(reader);
break;
case "offers":
node.Offers = reader.ReadElementContentAsArray(MarketplaceAppOfferNode.ParseXml);
break;
case "publisherId":
node.PublisherId = reader.ReadElementContentAsString();
break;
case "publisherGuid":
node.PublisherGuid = reader.ReadElementContentAsUrn();
break;
case "a:entry":
node.Entry = MarketplaceAppEntryNode.ParseXml(reader);
break;
default:
reader.Skip();
break;
}
}
//.........这里部分代码省略.........