VirtualTypeBuilder.MethodInfoCollection.Add Method (String, Type, [])

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

'宣言
Public Function Add ( _
    name As String, _
    returnType As Type, _
    paramTypes As Type() _
) As Integer
'使用
Dim instance As VirtualTypeBuilder..::.MethodInfoCollection
Dim name As String
Dim returnType As Type
Dim paramTypes As Type()
Dim returnValue As Integer

returnValue = instance.Add(name, returnType, _
    paramTypes)
public int Add(
    string name,
    Type returnType,
    Type[] paramTypes
)
public:
int Add(
    String^ name, 
    Type^ returnType, 
    array<Type^>^ paramTypes
)
public function Add(
    name : String, 
    returnType : Type, 
    paramTypes : Type[]
) : int

Parameters

  • returnType
    Type: System.Type

    The return type of the method. This should be typeof(void) for void return types.

  • paramTypes
    Type: []

    The types of the parameters to this method. This can be a null reference (Nothing in Visual Basic) or an empty array to declare no parameters.

Return Value

Type: System.Int32

The index at which the value has been added.

Exceptions

Exception Condition
ArgumentNullException

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

-or-

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

-or-

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

paramTypes property may be a null reference (Nothing in Visual Basic).

ArgumentException

returnType is not a run-time type.

Permissions

See Also

Reference

VirtualTypeBuilder.MethodInfoCollection Class

VirtualTypeBuilder.MethodInfoCollection Members

Add Overload

Microsoft.VisualStudio.Shell.Design Namespace