Freigeben über


VirtualTypeBuilder.MethodInfoCollection.Add Method (String, Type, array<Type[], array<Attribute , MethodAttributes)

Adds a MethodInfo to the end of the collection.

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

Syntax

'Declaration
Public Function Add ( _
    name As String, _
    returnType As Type, _
    parameterTypes As Type(), _
    attributes As Attribute(), _
    methodAttributes As MethodAttributes _
) As Integer
'Usage
Dim instance As VirtualTypeBuilder..::..MethodInfoCollection
Dim name As String
Dim returnType As Type
Dim parameterTypes As Type()
Dim attributes As Attribute()
Dim methodAttributes As MethodAttributes
Dim returnValue As Integer

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

Parameters

  • returnType
    Type: System.Type
    The return type of the method. This should be typeof(void) for void return types.

Return Value

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

Exceptions

Exception Condition
ArgumentNullException

name is nulla null reference (Nothing in Visual Basic).

-or-

returnType is nulla null reference (Nothing in Visual Basic).

-or-

An element in paramTypes is nulla null reference (Nothing in Visual Basic).

-or-

An element in attributes is nulla null reference (Nothing in Visual Basic).

attributes and paramTypes properties may be nulla null reference (Nothing in Visual Basic).

ArgumentException

handlerType is not a run-time type.

.NET Framework Security

See Also

Reference

VirtualTypeBuilder.MethodInfoCollection Class

VirtualTypeBuilder.MethodInfoCollection Members

Add Overload

Microsoft.VisualStudio.Shell.Design Namespace