Olvasás angol nyelven Szerkesztés

Megosztás a következőn keresztül:


PropertyDescriptor.CreateInstance(Type) Method

Definition

Creates an instance of the specified type.

C#
protected object? CreateInstance(Type type);
C#
protected object CreateInstance(Type type);

Parameters

type
Type

A Type that represents the type to create.

Returns

A new instance of the type.

Remarks

CreateInstance looks for a constructor that takes the specified type. If it finds a constructor, the type of the property is passed in.

Converters and editors use this method to create versions of a component. This method enables a single component to be reused for more than one type.

Applies to

Termék Verziók
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

See also