Compartilhar via


VirtualTypeBuilder.MethodInfoCollection.Add Method

Definition

Overloads

Add(MethodInfo)

Adds a MethodInfo to the end of the collection.

Add(String, Type, Type[])

Adds a MethodInfo to the end of the collection.

Add(String, Type, Type[], Attribute[])

Adds a MethodInfo to the end of the collection.

Add(String, Type, Type[], Attribute[], MethodAttributes)

Adds a MethodInfo to the end of the collection.

Add(MethodInfo)

Adds a MethodInfo to the end of the collection.

public:
 int Add(System::Reflection::MethodInfo ^ value);
public int Add (System.Reflection.MethodInfo value);
member this.Add : System.Reflection.MethodInfo -> int
Public Function Add (value As MethodInfo) As Integer

Parameters

value
MethodInfo

The MethodInfo to be added to the end of the collection.

Returns

The index at which the value has been added.

Applies to

Add(String, Type, Type[])

Adds a MethodInfo to the end of the collection.

public:
 int Add(System::String ^ name, Type ^ returnType, cli::array <Type ^> ^ parameterTypes);
public:
 int Add(Platform::String ^ name, Platform::Type ^ returnType, Platform::Array <Platform::Type ^> ^ parameterTypes);
public int Add (string name, Type returnType, Type[] parameterTypes);
member this.Add : string * Type * Type[] -> int
Public Function Add (name As String, returnType As Type, parameterTypes As Type()) As Integer

Parameters

name
String

The name of the method to add.

returnType
Type

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

parameterTypes
Type[]

Returns

The index at which the value has been added.

Exceptions

name is null.-or- returnType is null.-or-An element in paramTypes is null. paramTypes property may be null.

returnType is not a run-time type.

Applies to

Add(String, Type, Type[], Attribute[])

Adds a MethodInfo to the end of the collection.

public:
 int Add(System::String ^ name, Type ^ returnType, cli::array <Type ^> ^ parameterTypes, cli::array <Attribute ^> ^ attributes);
public:
 int Add(Platform::String ^ name, Platform::Type ^ returnType, Platform::Array <Platform::Type ^> ^ parameterTypes, Platform::Array <Platform::Metadata::Attribute ^> ^ attributes);
public int Add (string name, Type returnType, Type[] parameterTypes, Attribute[] attributes);
member this.Add : string * Type * Type[] * Attribute[] -> int
Public Function Add (name As String, returnType As Type, parameterTypes As Type(), attributes As Attribute()) As Integer

Parameters

name
String

The name of the method to add.

returnType
Type

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

parameterTypes
Type[]
attributes
Attribute[]

This parameter is used to configure the class member appropriately. The Add(String, Type, Type[], Attribute[]) method only accepts the values of MemberAttributes that fit into the AccessMask or ScopeMask categories.

Returns

The index at which the value has been added.

Exceptions

name is null.-or- returnType is null.-or-An element in paramTypes is null.-or-An element in attributes is null. attributes and paramTypes properties may be null.

handlerType is not a run-time type.

Applies to

Add(String, Type, Type[], Attribute[], MethodAttributes)

Adds a MethodInfo to the end of the collection.

public:
 int Add(System::String ^ name, Type ^ returnType, cli::array <Type ^> ^ parameterTypes, cli::array <Attribute ^> ^ attributes, System::Reflection::MethodAttributes methodAttributes);
public int Add (string name, Type returnType, Type[] parameterTypes, Attribute[] attributes, System.Reflection.MethodAttributes methodAttributes);
member this.Add : string * Type * Type[] * Attribute[] * System.Reflection.MethodAttributes -> int
Public Function Add (name As String, returnType As Type, parameterTypes As Type(), attributes As Attribute(), methodAttributes As MethodAttributes) As Integer

Parameters

name
String

The name of the method to add.

returnType
Type

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

parameterTypes
Type[]
attributes
Attribute[]

This parameter is used to configure the class member appropriately. The Add(String, Type, Type[], Attribute[], MethodAttributes) method only accepts the values of MemberAttributes that fit into the AccessMask or ScopeMask categories.

methodAttributes
MethodAttributes

This parameter specifies additional event attributes for this member. The default method attribute is Public. The only method attributes supported today are Public and Static .

Returns

The index at which the value has been added.

Exceptions

name is null.-or- returnType is null.-or-An element in paramTypes is null.-or-An element in attributes is null. attributes and paramTypes properties may be null.

handlerType is not a run-time type.

Applies to