本文整理汇总了C#中System.Xml.XmlNode.OfType方法的典型用法代码示例。如果您正苦于以下问题:C# XmlNode.OfType方法的具体用法?C# XmlNode.OfType怎么用?C# XmlNode.OfType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.XmlNode
的用法示例。
在下文中一共展示了XmlNode.OfType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create
public object Create(object parent, object configContext, XmlNode section)
{
var configuration = new MessageAddressConversionConfiguration();
configuration.InboundTemplates.AddRange(section
.OfType<XmlElement>()
.Where(x => "inboundTemplate".Equals(x.Name, StringComparison.OrdinalIgnoreCase))
.Select(route => route.InnerText));
configuration.OutboundTemplates.AddRange(section
.OfType<XmlElement>()
.Where(x => "outboundTemplate".Equals(x.Name, StringComparison.OrdinalIgnoreCase))
.Select(route => route.InnerText));
return configuration;
}
开发者ID:nayato,项目名称:azure-iot-protocol-gateway,代码行数:13,代码来源:MessageAddressConversionConfigurationHandler.cs
示例2: Create
public object Create(object parent, object configContext, XmlNode section)
{
var configuration = new RoutingConfiguration();
configuration.InboundRoutes.AddRange(section
.OfType<XmlElement>()
.Where(x => "inboundRoute".Equals(x.Name, StringComparison.OrdinalIgnoreCase))
.Select(route => InboundRouteDefinition.Create(
route.OfType<XmlElement>().Where(x => "template".Equals(x.Name, StringComparison.OrdinalIgnoreCase)).Select(x => x.InnerText),
ParseInboundRouteType(route.GetAttribute("to")))));
configuration.OutboundRoutes.AddRange(section
.OfType<XmlElement>()
.Where(x => "outboundRoute".Equals(x.Name, StringComparison.OrdinalIgnoreCase))
.Select(route => OutboundRouteDefinition.Create(
ParseOutboundRouteType(route.GetAttribute("from")),
route.OfType<XmlElement>().Single(x => "template".Equals(x.Name, StringComparison.OrdinalIgnoreCase)).InnerText)));
return configuration;
}
示例3: ProcessParameter
private static void ProcessParameter(XmlNode parameter)
{
if (parameter.Attributes == null) return;
var attr = parameter.Attributes["defaultValue"] == null ? "" : parameter.Attributes["defaultValue"].InnerText;
var value = Params[parameter.Attributes["name"].InnerText] as string ?? attr;
foreach (var entry in parameter.OfType<XmlLinkedNode>())
{
ApplyEntry(entry, value);
}
}