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)
Syntax
'宣言
Public Function Add ( _
name As String, _
handlerType As Type, _
attributes As Attribute() _
) As Integer
'使用
Dim instance As VirtualTypeBuilder..::.EventInfoCollection
Dim name As String
Dim handlerType As Type
Dim attributes As Attribute()
Dim returnValue As Integer
returnValue = instance.Add(name, handlerType, _
attributes)
public int Add(
string name,
Type handlerType,
Attribute[] attributes
)
public:
int Add(
String^ name,
Type^ handlerType,
array<Attribute^>^ attributes
)
public function Add(
name : String,
handlerType : Type,
attributes : Attribute[]
) : int
Parameters
name
Type: System.StringThe name of the event to add.
handlerType
Type: System.TypeThe type of delegate this event represents.
Return Value
Type: System.Int32
The index at which the value has been added.
Exceptions
| Exception | Condition |
|---|---|
| ArgumentNullException | name or handlerType or an element in attributes is a null reference (Nothing in Visual Basic). attributes itself may be a null reference (Nothing in Visual Basic). |
| ArgumentException | handlerType is not a run-time type. |
Permissions
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
VirtualTypeBuilder.EventInfoCollection Class