Condividi tramite


Metodo VirtualTypeBuilder.EventInfoCollection.Add (String, Type, array<Attribute , MethodAttributes)

Aggiunge EventInfo della raccolta.

Spazio dei nomi:  Microsoft.VisualStudio.Shell.Design
Assembly:  Microsoft.VisualStudio.Shell.Design (in Microsoft.VisualStudio.Shell.Design.dll)

Sintassi

'Dichiarazione
Public Function Add ( _
    name As String, _
    handlerType As Type, _
    attributes As Attribute(), _
    methodAttributes As MethodAttributes _
) As Integer
public int Add(
    string name,
    Type handlerType,
    Attribute[] attributes,
    MethodAttributes methodAttributes
)

Parametri

  • handlerType
    Tipo: System.Type
    il tipo di delegato che questo evento rappresenta.

Valore restituito

Tipo: System.Int32
L'indice il cui valore è stato aggiunto.

Eccezioni

Eccezione Condizione
ArgumentNullException

name o handlerType o un elemento in attributes è nullriferimento null (Nothing in Visual Basic).attributes può essere nullriferimento null (Nothing in Visual Basic).

ArgumentException

handlerType non è un tipo di runtime

- oppure-

methodAttributes non contiene Public o non contiene i bit impostati diverso da Public e di Static, gli attributi o passati al parametro di attributes non possono essere applicate agli eventi.

Sicurezza di .NET Framework

Vedere anche

Riferimenti

VirtualTypeBuilder.EventInfoCollection Classe

Overload Add

Spazio dei nomi Microsoft.VisualStudio.Shell.Design