本文整理汇总了C#中System.Xml.XmlReader.ReadElementContentAsArray方法的典型用法代码示例。如果您正苦于以下问题:C# XmlReader.ReadElementContentAsArray方法的具体用法?C# XmlReader.ReadElementContentAsArray怎么用?C# XmlReader.ReadElementContentAsArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.XmlReader
的用法示例。
在下文中一共展示了XmlReader.ReadElementContentAsArray方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParseXml
internal static ApplicationManifestTaskNodeBase ParseXml(XmlReader reader)
{
switch (reader.Name)
{
case "DefaultTask":
var node = new ApplicationManifestDefaultTaskNode()
{
Name = reader.GetAttribute("Name"),
NavigationPage = reader.GetAttribute("NavigationPage")
};
reader.Skip();
return node;
case "ExtendedTask":
var node2 = new ApplicationManifestExtendedTaskNode
{
Name = reader.GetAttribute("Name"),
BackgroundServiceAgents = reader.ReadElementContentAsArray(ApplicationManifestBackgroundServiceAgentNode.ParseXml)
};
return node2;
default:
reader.Skip();
return null;
}
}
示例2: ParseXml
internal static ApplicationManifestAppNode ParseXml(XmlReader reader)
{
var node = new ApplicationManifestAppNode()
{
Author = reader.GetAttribute("Author"),
BitsPerPixel = reader.GetAttribute("BitsPerPixel"),
Description = reader.GetAttribute("Description"),
Genre = reader.GetAttribute("Genre"),
HasSettings = reader.GetAttributeAsBool("HasSettings"),
HubType = reader.GetAttributeAsInt("HubType"),
IsBeta = reader.GetAttributeAsBool("IsBeta"),
ProductId = reader.GetAttribute("ProductID"),
Publisher = reader.GetAttribute("Publisher"),
PublisherId = reader.GetAttribute("PublisherID"),
Title = reader.GetAttribute("Title"),
Version = reader.GetAttribute("Version"),
};
reader.ReadStartElement();
while (reader.NodeType != XmlNodeType.EndElement)
{
switch (reader.Name)
{
case "IconPath":
node.IconPath = ApplicationManifestIconPathNode.ParseXml(reader);
break;
case "Capabilities":
node.Capabilities = reader.ReadElementContentAsArray(ApplicationManifestNamedNode.ParseXml);
break;
case "ScreenResolutions":
node.ScreenResolutions = reader.ReadElementContentAsArray(ApplicationManifestNamedNode.ParseXml);
break;
case "Requirements":
node.Requirements = reader.ReadElementContentAsArray(ApplicationManifestNamedNode.ParseXml);
break;
case "Tasks":
node.Tasks = reader.ReadElementContentAsArray(ApplicationManifestTaskNodeBase.ParseXml);
break;
case "Tokens":
node.Tokens = reader.ReadElementContentAsArray(ApplicationManifestTokenNode.ParseXml);
break;
default:
reader.Skip();
break;
}
}
reader.ReadEndElement();
return node;
}
示例3: 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;
}
示例4: ParseXml
internal static ApplicationManifest ParseXml(XmlReader reader)
{
reader.MoveToContent();
var node = new ApplicationManifest
{
AppPlatformVersion = reader.GetAttribute("AppPlatformVersion")
};
reader.ReadStartElement();
while (reader.NodeType != XmlNodeType.EndElement)
{
switch (reader.Name)
{
case "DefaultLanguage":
node.DefaultLanguage = ApplicationManifestLanguageNode.ParseXml(reader);
break;
case "AppExtra":
node.AppExtras = reader.ReadElementContentAsArray(ApplicationManifestNamedNode.ParseXml);
break;
case "Languages":
node.Languages = reader.ReadElementContentAsArray(ApplicationManifestLanguageNode.ParseXml);
break;
case "App":
node.App = ApplicationManifestAppNode.ParseXml(reader);
break;
default:
reader.Skip();
break;
}
}
reader.ReadEndElement();
return node;
}
示例5: ParseXml
internal static WindowsStoreServiceAppNode ParseXml(XmlReader reader)
{
var node = new WindowsStoreServiceAppNode();
reader.ReadStartElement();
while (reader.NodeType != XmlNodeType.EndElement)
{
switch (reader.Name)
{
case "Pt":
node.Package = WindowsStoreServiceAppPackageNode.ParseXml(reader);
break;
case "D":
node.Description = reader.ReadElementContentAsString();
break;
case "Dbps":
node.Features = reader.ReadElementContentAsArray(x => x.ReadElementContentAsString());
break;
case "Ud":
node.UpdateDescription = reader.ReadElementContentAsString();
break;
case "Bsl":
node.BaseLanguage = reader.ReadElementContentAsString();
break;
case "Sls":
node.SupportedLanguages = reader.ReadElementContentAsArray(x => x.ReadElementContentAsString());
break;
case "Dev":
node.DeveloperName = reader.ReadElementContentAsString();
break;
case "DevI":
node.DeveloperId = reader.ReadElementContentAsString();
break;
case "Cr":
node.Copyright = reader.ReadElementContentAsString();
break;
case "Ws":
node.Website = reader.ReadElementContentAsString();
break;
case "Sws":
node.SupportWebsite = reader.ReadElementContentAsString();
break;
case "Pu":
node.PrivacyPolicyWebsite = reader.ReadElementContentAsString();
break;
case "Eula":
node.EndUserLicenseAgreement = reader.ReadElementContentAsString();
break;
case "Sas2":
node.SupportedArchitectures = reader.ReadElementContentAsArray(WindowsStoreServiceAppArchitectureNode.ParseXml);
break;
case "Sss":
node.Screenshots = reader.ReadElementContentAsArray(WindowsStoreServiceAppScreenshotNode.ParseXml);
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;
}
}
//.........这里部分代码省略.........