TypeDescriptor.CreateProperty Method (Type, String, Type, Attribute[])

 

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

Namespace:   System.ComponentModel
Assembly:  System (in System.dll)

[ReflectionPermissionAttribute(SecurityAction.LinkDemand, Flags = ReflectionPermissionFlag.MemberAccess)]
public static PropertyDescriptor CreateProperty(
	Type componentType,
	string name,
	Type type,
	params Attribute[] attributes
)

Parameters

componentType
Type: System.Type

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

name
Type: System.String

The name of the property.

type
Type: System.Type

The Type of the property.

attributes
Type: System.Attribute[]

The new attributes for this property.

Return Value

Type: System.ComponentModel.PropertyDescriptor

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

ReflectionPermission

Required to inspect non-public members of the component. Link demand access required for ReflectionPermissionFlag type MemberAccess.

.NET Framework
Available since 1.1
Return to top
Show: