TypeDescriptor.CreateProperty Method

Definition

Creates a new property descriptor for an existing property of a component.

Overloads

CreateProperty(Type, PropertyDescriptor, Attribute[])

Creates a new property descriptor from an existing property descriptor, using the specified existing PropertyDescriptor and attribute array.

CreateProperty(Type, String, Type, Attribute[])

Creates and dynamically binds a property descriptor to a type, using the specified property name, type, and attribute array.

CreateProperty(Type, PropertyDescriptor, Attribute[])

Source:
TypeDescriptor.cs
Source:
TypeDescriptor.cs
Source:
TypeDescriptor.cs

Creates a new property descriptor from an existing property descriptor, using the specified existing PropertyDescriptor and attribute array.

C#
public static System.ComponentModel.PropertyDescriptor CreateProperty(Type componentType, System.ComponentModel.PropertyDescriptor oldPropertyDescriptor, params Attribute[] attributes);

Parameters

componentType
Type

The Type of the component that the property is a member of.

oldPropertyDescriptor
PropertyDescriptor

The existing property descriptor.

attributes
Attribute[]

The new attributes for this property.

Returns

A new PropertyDescriptor that has the specified metadata attributes merged with the existing metadata attributes.

See also

Applies to

.NET 9 and other versions
Product Versions
.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
.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 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0, 2.1

CreateProperty(Type, String, Type, Attribute[])

Source:
TypeDescriptor.cs
Source:
TypeDescriptor.cs
Source:
TypeDescriptor.cs

Creates and dynamically binds a property descriptor to a type, using the specified property name, type, and attribute array.

C#
public static System.ComponentModel.PropertyDescriptor CreateProperty(Type componentType, string name, Type type, params Attribute[] attributes);

Parameters

componentType
Type

The Type of the component that the property is a member of.

name
String

The name of the property.

type
Type

The Type of the property.

attributes
Attribute[]

The new attributes for this property.

Returns

A PropertyDescriptor that is bound to the specified type and that has the specified metadata attributes merged with the existing metadata attributes.

See also

Applies to

.NET 9 and other versions
Product Versions
.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
.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 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0, 2.1