예제 #1
0
        public JSONSerializer(SupportedJsonParserTypes parserType)
        {
            // The West Wind Parser is native
            if (parserType == SupportedJsonParserTypes.WestWindJsonSerializer)
            {
                _serializer = new WestwindJsonSerializer(this);
            }

#if (true) //JSONNET_REFERENCE)
            else if (parserType == SupportedJsonParserTypes.JsonNet)
            {
                _serializer = new JsonNetJsonSerializer(this);
            }
            //_serializer = new JsonNetJsonSerializerOld(this);
#endif
            else if (parserType == SupportedJsonParserTypes.JavaScriptSerializer)
            {
                _serializer = new WebExtensionsJavaScriptSerializer(this);
            }

            else
            {
                throw new InvalidOperationException(Resources.UnsupportedJSONSerializerSpecified);
            }
        }
예제 #2
0
        public JsonSerializer(SupportedJsonParserTypes parserType)
        {
            this.FormatJsonOutput = false;
            // The West Wind Parser is native
            if (parserType == SupportedJsonParserTypes.WestWindJsonSerializer)
            {
                this.serializer = new WestwindJsonSerializer(this);
            }

#if (true) //JSONNET_REFERENCE)
           //else if (parserType == SupportedJsonParserTypes.JsonNet)
           //    _serializer = new JsonNetJsonSerializer(this);
#endif
            //else if (parserType == SupportedJsonParserTypes.JavaScriptSerializer)
            //    _serializer = new WebExtensionsJavaScriptSerializer(this);

            else
            {
                throw new InvalidOperationException("Unsuported serializer");
            }
        }
예제 #3
0
        public JSONSerializer(SupportedJsonParserTypes parserType)
        {
            // The West Wind Parser is native
            if (parserType == SupportedJsonParserTypes.CustomJsonSerializer)
            {
                _serializer = new CustomJsonSerializer(this);
            }

#if (true) //JSONNET_REFERENCE)
            else if (parserType == SupportedJsonParserTypes.JsonNet)
            {
                _serializer = new JsonNetJsonSerializer(this);
            }
#endif
            else if (parserType == SupportedJsonParserTypes.JavaScriptSerializer)
            {
                _serializer = new WebExtensionsJavaScriptSerializer(this);
            }

            else
            {
                throw new InvalidOperationException();
            }
        }