/// <summary> /// Loads the settings for the named <paramref name="configSection"/>. /// </summary> /// <param name="configSection">the name of a json serializer config section</param> /// <returns>configured serializer settings</returns> public static ISerializerSettings Load(string configSection) { var settings = new SerializerSettings(); Configure(settings, configSection); return(settings); }
/// <summary> /// Constructs a serializer with an existing context to (de)serialize the given type /// </summary> /// <param name="type">the type to serialize/deserialize</param> /// <param name="settings">the serializer settings to customize how the serializer operates</param> public Serializer(SerializerSettings settings) { if (settings == null) { throw new ArgumentNullException("settings"); } Settings = settings; }
/// <summary> /// Constructs a serializer to (de)serialize the given type using the /// specified configuration section. /// </summary> /// <param name="type">the type to serialize/deserialize</param> public Serializer(string configSection) { Settings = new SerializerSettings(); XmlConfigurator.Configure(Settings, configSection); }