TypeDescriptor::CreateEvent Method (Type^, String^, Type^, array<Attribute^>^)

 

Creates a new event descriptor that is identical to an existing event descriptor by dynamically generating descriptor information from a specified event on a type.

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

public:
[ReflectionPermissionAttribute(SecurityAction::LinkDemand, Flags = ReflectionPermissionFlag::MemberAccess)]
static EventDescriptor^ CreateEvent(
	Type^ componentType,
	String^ name,
	Type^ type,
	... array<Attribute^>^ attributes
)

Parameters

componentType
Type: System::Type^

The type of the component the event lives on.

name
Type: System::String^

The name of the event.

type
Type: System::Type^

The type of the delegate that handles the event.

attributes
Type: array<System::Attribute^>^

The attributes for this event.

Return Value

Type: System.ComponentModel::EventDescriptor^

An EventDescriptor that is bound to a type.

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: