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;
 }
 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;
 }
Esempio n. 3
0
 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);
     }
 }