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 Function Add ( _
    name As String, _
    handlerType As Type, _
    attributes As Attribute(), _
    methodAttributes As MethodAttributes _
) As Integer
‘사용 방법
Dim instance As VirtualTypeBuilder..::..EventInfoCollection
Dim name As String
Dim handlerType As Type
Dim attributes As Attribute()
Dim methodAttributes As MethodAttributes
Dim returnValue As Integer

returnValue = instance.Add(name, handlerType, _
    attributes, methodAttributes)
public int Add(
    string name,
    Type handlerType,
    Attribute[] attributes,
    MethodAttributes methodAttributes
int Add(
    String^ name, 
    Type^ handlerType, 
    array<Attribute^>^ attributes, 
    MethodAttributes methodAttributes
member Add : 
        name:string * 
        handlerType:Type * 
        attributes:Attribute[] * 
        methodAttributes:MethodAttributes -> int 
public function Add(
    name : String, 
    handlerType : Type, 
    attributes : Attribute[], 
    methodAttributes : MethodAttributes
) : int


  • handlerType
    Type: System.Type
    The type of delegate this event represents.

Return Value

Type: System.Int32
The index at which the value has been added.


Exception Condition

name or handlerType or an element in attributes is nulla null reference (Nothing in Visual Basic). attributes itself may be nulla null reference (Nothing in Visual Basic).


handlerType is not a run-time type


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.

.NET Framework Security

See Also


VirtualTypeBuilder.EventInfoCollection Class

VirtualTypeBuilder.EventInfoCollection Members

Add Overload

Microsoft.VisualStudio.Shell.Design Namespace