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);
             }
         }
     }
 }
Esempio n. 2
0
 public SerializationConfig ConfigureGlobalSerializer(Action <GlobalSerializerConfig> configAction)
 {
     if (GlobalSerializerConfig == null)
     {
         GlobalSerializerConfig = new GlobalSerializerConfig();
     }
     configAction(GlobalSerializerConfig);
     return(this);
 }
 public virtual SerializationConfig SetGlobalSerializerConfig(GlobalSerializerConfig globalSerializerConfig)
 {
     this.globalSerializerConfig = globalSerializerConfig;
     return this;
 }
 /// <summary>
 /// Sets <see cref="GlobalSerializerConfig"/>
 /// </summary>
 /// <param name="globalSerializerConfig"><see cref="GlobalSerializerConfig"/></param>
 /// <returns>configured <see cref="SerializationConfig"/> for chaining</returns>
 public virtual SerializationConfig SetGlobalSerializerConfig(GlobalSerializerConfig globalSerializerConfig)
 {
     _globalSerializerConfig = globalSerializerConfig;
     return(this);
 }
 protected internal virtual 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);
             }
         }
     }
 }