Szerkesztés

Megosztás a következőn keresztül:


SignatureHelper.AddArgument Method

Definition

Adds an argument to the signature.

Overloads

AddArgument(Type)

Adds an argument to the signature.

AddArgument(Type, Boolean)

Adds an argument of the specified type to the signature, specifying whether the argument is pinned.

AddArgument(Type, Type[], Type[])

Adds an argument to the signature, with the specified custom modifiers.

AddArgument(Type)

Source:
SignatureHelper.cs
Source:
SignatureHelper.cs
Source:
SignatureHelper.cs

Adds an argument to the signature.

public:
 void AddArgument(Type ^ clsArgument);
public void AddArgument (Type clsArgument);
member this.AddArgument : Type -> unit
Public Sub AddArgument (clsArgument As Type)

Parameters

clsArgument
Type

The type of the argument.

Exceptions

The signature has already been finished.

clsArgument is null.

Remarks

To add an argument with optional or required custom modifiers, use the AddArgument(Type, Type[], Type[]) method overload.

Applies to

AddArgument(Type, Boolean)

Source:
SignatureHelper.cs
Source:
SignatureHelper.cs
Source:
SignatureHelper.cs

Adds an argument of the specified type to the signature, specifying whether the argument is pinned.

public:
 void AddArgument(Type ^ argument, bool pinned);
public void AddArgument (Type argument, bool pinned);
member this.AddArgument : Type * bool -> unit
Public Sub AddArgument (argument As Type, pinned As Boolean)

Parameters

argument
Type

The argument type.

pinned
Boolean

true if the argument is pinned; otherwise, false.

Exceptions

argument is null.

Remarks

To add an argument with optional or required custom modifiers, use the AddArgument(Type, Type[], Type[]) method overload.

Applies to

AddArgument(Type, Type[], Type[])

Source:
SignatureHelper.cs
Source:
SignatureHelper.cs
Source:
SignatureHelper.cs

Adds an argument to the signature, with the specified custom modifiers.

public:
 void AddArgument(Type ^ argument, cli::array <Type ^> ^ requiredCustomModifiers, cli::array <Type ^> ^ optionalCustomModifiers);
public void AddArgument (Type argument, Type[]? requiredCustomModifiers, Type[]? optionalCustomModifiers);
public void AddArgument (Type argument, Type[] requiredCustomModifiers, Type[] optionalCustomModifiers);
member this.AddArgument : Type * Type[] * Type[] -> unit
Public Sub AddArgument (argument As Type, requiredCustomModifiers As Type(), optionalCustomModifiers As Type())

Parameters

argument
Type

The argument type.

requiredCustomModifiers
Type[]

An array of types representing the required custom modifiers for the argument, such as IsConst or IsBoxed. If the argument has no required custom modifiers, specify null.

optionalCustomModifiers
Type[]

An array of types representing the optional custom modifiers for the argument, such as IsConst or IsBoxed. If the argument has no optional custom modifiers, specify null.

Exceptions

argument is null.

-or-

An element of requiredCustomModifiers or optionalCustomModifiers is null.

The signature has already been finished.

-or-

One of the specified custom modifiers is an array type.

-or-

One of the specified custom modifiers is an open generic type. That is, the ContainsGenericParameters property is true for the custom modifier.

Remarks

See the System.Runtime.CompilerServices namespace for classes that represent custom modifiers.

Applies to