System.ComponentModel.TypeDescriptor.TypeDescriptionNode.CreateInstance C# (CSharp) Method

CreateInstance() public method

Implements CreateInstance. This just walks the linked list looking for someone who implements the call.
public CreateInstance ( IServiceProvider provider, Type objectType, Type argTypes, object args ) : object
provider IServiceProvider
objectType System.Type
argTypes System.Type
args object
return object
            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);
            }