// The JITer enforces CAS. By creating a separate method we can avoid getting SecurityExceptions 
        // when we weren't going to really call TypeDescriptor.AddProvider.
        internal static void RegisterCustomTypeDescriptor(TypeDescriptionProvider tdp, Type type)
        {
            // Check if we already registered provider with the specified type.
            HashSet<Type> existingProviders = _typeDescriptionProviderMap.GetOrAdd(type, t =>
            {
                return new HashSet<Type>();
            });

            if (!existingProviders.Contains(tdp.GetType()))
            {
                TypeDescriptor.AddProviderTransparent(tdp, type);
                existingProviders.Add(tdp.GetType());
            }
        }