Пример #1
0
        private static void ResetDefault()
        {
            var rootType = typeof(ObjectDataConverter);
            var defaults = AssemblyCache.Assemblies.SelectMany(asm => asm.GetTypes())
                           .Where(t => rootType.IsAssignableFrom(t))
                           .Select(GetDefaultOrCreate)
                           .Where(c => c != null);

            Default = new ObjectDataConverterCollection(defaults);
        }
Пример #2
0
        private static ObjectDataConverter SelectConverter(
            ObjectDataConverterSelector selector, ObjectDataConverterCollection collection, Type convertType)
        {
            if (selector == null)
            {
                selector = ObjectDataConverterSelector.Default;
            }
            var converter = selector.Select(collection ?? ObjectDataConverterCollection.Default, convertType);

            return(converter ?? Default);
        }