System.ComponentModel.PropertyDescriptor.CreateInstance C# (CSharp) 메소드

CreateInstance() 보호된 메소드

Creates an instance of the specified type.

protected CreateInstance ( Type type ) : object
type System.Type
리턴 object
        protected object CreateInstance(Type type)
        {
            Type[] typeArgs = new Type[] { typeof(Type) };
            ConstructorInfo ctor = type.GetTypeInfo().GetConstructor(typeArgs);
            if (ctor != null)
            {
                return TypeDescriptor.CreateInstance(null, type, typeArgs, new object[] { PropertyType });
            }

            return TypeDescriptor.CreateInstance(null, type, null, null);
        }