public override object CreateInstance(IServiceProvider provider, Type objectType, Type[] argTypes, object[] args)
{
if (objectType == null)
{
throw new ArgumentNullException(nameof(objectType));
}
if (argTypes != null)
{
if (args == null)
{
throw new ArgumentNullException(nameof(args));
}
if (argTypes.Length != args.Length)
{
throw new ArgumentException(SR.TypeDescriptorArgsCountMismatch);
}
}
return Provider.CreateInstance(provider, objectType, argTypes, args);
}