Exemplo n.º 1
0
        internal static bool HasMatchingConverter(IList <JsonConverter> converters, Type objectType, out JsonConverter matchingConverter)
        {
            if (objectType == null)
            {
                throw new ArgumentNullException("objectType");
            }

            if (converters != null)
            {
                for (int i = 0; i < converters.Count; i++)
                {
                    JsonConverter converter = converters[i];

                    if (converter.CanConvert(objectType))
                    {
                        matchingConverter = converter;
                        return(true);
                    }
                }
            }

            matchingConverter = null;
            return(false);
        }
Exemplo n.º 2
0
 internal bool HasMatchingConverter(Type type, out JsonConverter matchingConverter)
 {
     return(HasMatchingConverter(_converters, type, out matchingConverter));
 }