SignatureHelper.AddArgument 方法
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
加入引數至簽章。
AddArgument(Type) |
加入引數至簽章。 |
AddArgument(Type, Boolean) |
將指定之型別的引數加入簽章,指定該引數是否為固定 (Pin) 。 |
AddArgument(Type, Type[], Type[]) |
使用指定的自訂修飾詞,將引數加入簽章。 |
加入引數至簽章。
public:
void AddArgument(Type ^ clsArgument);
public void AddArgument (Type clsArgument);
member this.AddArgument : Type -> unit
Public Sub AddArgument (clsArgument As Type)
參數
- clsArgument
- Type
引數型別。
例外狀況
簽章已經完成。
clsArgument
為 null
。
備註
若要新增具有選擇性或必要自定義修飾詞的自變數,請使用 AddArgument(Type, Type[], Type[]) 方法多載。
適用於
.NET 9 和其他版本
產品 | 版本 |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
將指定之型別的引數加入簽章,指定該引數是否為固定 (Pin) 。
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)
參數
- argument
- Type
引數型別。
- pinned
- Boolean
如果引數為固定 (Pin),則為 true
,否則為 false
。
例外狀況
argument
為 null
。
備註
若要新增具有選擇性或必要自定義修飾詞的自變數,請使用 AddArgument(Type, Type[], Type[]) 方法多載。
適用於
.NET 9 和其他版本
產品 | 版本 |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
使用指定的自訂修飾詞,將引數加入簽章。
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())
參數
- argument
- Type
引數型別。
例外狀況
argument
為 null
。
-或-
requiredCustomModifiers
或 optionalCustomModifiers
的項目為 null
。
簽章已經完成。
-或-
其中一個指定的自訂修飾詞為陣列型別。
-或-
其中一個指定的自訂修飾詞為開放泛型型別。 也就是說,自訂修飾詞的 ContainsGenericParameters 屬性為 true
。
備註
System.Runtime.CompilerServices請參閱代表自定義修飾詞之類別的命名空間。
適用於
.NET 9 和其他版本
產品 | 版本 |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |