Esempio n. 1
0
        public void RegisterConverter(JsonConverter converter)
        {
            BasicConverters.Add(converter);
            ReadableConverters.Add(converter);

            RebuildSerializers();
        }
        public void RegisterConverter(JsonConverter converter)
        {
            BasicConverters.Add(converter);
            ReadableConverters.Add(converter);

            _readableSettings = new JsonSerializerSettings
            {
                ContractResolver  = new CamelCasePropertyNamesContractResolver(),
                NullValueHandling = NullValueHandling.Ignore,
                Formatting        = Formatting.Indented,
                Converters        = ReadableConverters
            };

            _settings = new JsonSerializerSettings
            {
                ContractResolver  = new CamelCasePropertyNamesContractResolver(),
                NullValueHandling = NullValueHandling.Ignore,
                Formatting        = Formatting.None,
                Converters        = BasicConverters
            };

            _internalSerializer         = JsonSerializer.Create(_settings);
            _internalReadableSerializer = JsonSerializer.Create(_readableSettings);
        }