VirtualTypeBuilder::EventInfoCollection::Add Method (String^, Type^, array<Attribute^>^, MethodAttributes)

 

Adds an EventInfo to the end of the collection.

Namespace:   Microsoft.VisualStudio.Shell.Design
Assembly:  Microsoft.VisualStudio.Shell.Design (in Microsoft.VisualStudio.Shell.Design.dll)

public:
int Add(
	String^ name,
	Type^ handlerType,
	array<Attribute^>^ attributes,
	MethodAttributes methodAttributes
)

Parameters

name
Type: System::String^

The name of the event to add.

handlerType
Type: System::Type^

The type of delegate this event represents.

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

An array of Attribute objects.

methodAttributes
Type: System.Reflection::MethodAttributes

The only method attributes currently supported are Public and/or Static.

Return Value

Type: System::Int32

The index at which the value has been added.

Exception Condition
ArgumentNullException

name or handlerType or an element in attributes is null. attributes itself may be null.

ArgumentException

handlerType is not a run-time type

-or-

methodAttributes does not contain Public or contains set bits other than Public and Static, or attributes passed in through the attributes parameter cannot be applied to events.

Return to top
Show: