public static TypeDescriptionProvider AddAttributes(Type type, params Attribute[] attributes)
{
if (type == null)
{
throw new ArgumentNullException(nameof(type));
}
if (attributes == null)
{
throw new ArgumentNullException(nameof(attributes));
}
TypeDescriptionProvider existingProvider = GetProvider(type);
TypeDescriptionProvider provider = new AttributeProvider(existingProvider, attributes);
TypeDescriptor.AddProvider(provider, type);
return provider;
}