void FillSerializers
     (XmlNode node, SerializationConfig serializationConfig)
 {
     foreach (XmlNode child in node.ChildNodes)
     {
         string name  = CleanNodeName(child);
         string value = GetTextContent(child);
         if ("serializer".Equals(name))
         {
             var serializerConfig = new SerializerConfig();
             serializerConfig.SetClassName(value);
             string typeClassName = GetAttribute(child, "type-class");
             serializerConfig.SetTypeClassName(typeClassName);
             serializationConfig.AddSerializerConfig(serializerConfig);
         }
         else
         {
             if ("global-serializer".Equals(name))
             {
                 var globalSerializerConfig = new GlobalSerializerConfig();
                 globalSerializerConfig.SetClassName(value);
                 serializationConfig.SetGlobalSerializerConfig(globalSerializerConfig);
             }
         }
     }
 }
Example #2
0
 private static void FillSerializers(this SerializationConfig serializationConfig, XmlNode node)
 {
     foreach (XmlNode child in node.ChildNodes)
     {
         var name  = CleanNodeName(child);
         var value = GetTextContent(child);
         if ("serializer".Equals(name))
         {
             var serializerConfig = new SerializerConfig();
             serializerConfig.SetClassName(value);
             var typeClassName = GetAttribute(child, "type-class");
             serializerConfig.SetTypeClassName(typeClassName);
             serializationConfig.SerializerConfigs.Add(serializerConfig);
         }
         else
         {
             if ("global-serializer".Equals(name))
             {
                 serializationConfig.ConfigureGlobalSerializer(gs => { gs.TypeName = value; });
             }
         }
     }
 }