Example #1
0
            internal static int RegisterSerializers <T>()
            {
                var i = 0;

                i += Register <T, JsonTypeSerializer>();
                if (jsonSerializer.GetParseFn <T>() != null)
                {
                    i++;
                }
                if (jsonSerializer.GetWriteFn <T>() != null)
                {
                    i++;
                }
                if (jsonReader.GetParseFn <T>() != null)
                {
                    i++;
                }
                if (jsonWriter.GetWriteFn <T>() != null)
                {
                    i++;
                }

                i += Register <T, JsvTypeSerializer>();
                if (jsvSerializer.GetParseFn <T>() != null)
                {
                    i++;
                }
                if (jsvSerializer.GetWriteFn <T>() != null)
                {
                    i++;
                }
                if (jsvReader.GetParseFn <T>() != null)
                {
                    i++;
                }
                if (jsvWriter.GetWriteFn <T>() != null)
                {
                    i++;
                }


                //RegisterCsvSerializer<T>();
                RegisterQueryStringWriter();
                return(i);
            }
Example #2
0
        internal static ParseStringDelegate RegisterBuiltin <T>()
        {
            var i = 0;

            if (reader.GetParseFn <T>() != null)
            {
                i++;
            }
            if (JsonReader <T> .GetParseFn() != null)
            {
                i++;
            }
            if (JsonReader <T> .Parse(null) != null)
            {
                i++;
            }
            if (JsonWriter <T> .WriteFn() != null)
            {
                i++;
            }

            return(serializer.GetParseFn <T>());
        }