CodeParameterDeclarationExpression 建構函式
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
初始化 CodeParameterDeclarationExpression 類別的新執行個體。
CodeParameterDeclarationExpression() |
初始化 CodeParameterDeclarationExpression 類別的新執行個體。 |
CodeParameterDeclarationExpression(CodeTypeReference, String) |
使用指定的參數型別和名稱來初始化 CodeParameterDeclarationExpression 類別的新執行個體。 |
CodeParameterDeclarationExpression(String, String) |
使用指定的參數型別和名稱來初始化 CodeParameterDeclarationExpression 類別的新執行個體。 |
CodeParameterDeclarationExpression(Type, String) |
使用指定的參數型別和名稱來初始化 CodeParameterDeclarationExpression 類別的新執行個體。 |
初始化 CodeParameterDeclarationExpression 類別的新執行個體。
public:
CodeParameterDeclarationExpression();
public CodeParameterDeclarationExpression ();
Public Sub New ()
適用於
.NET Framework 4.8.1 和其他版本
產品 | 版本 |
---|---|
.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 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |
使用指定的參數型別和名稱來初始化 CodeParameterDeclarationExpression 類別的新執行個體。
public:
CodeParameterDeclarationExpression(System::CodeDom::CodeTypeReference ^ type, System::String ^ name);
public CodeParameterDeclarationExpression (System.CodeDom.CodeTypeReference type, string name);
new System.CodeDom.CodeParameterDeclarationExpression : System.CodeDom.CodeTypeReference * string -> System.CodeDom.CodeParameterDeclarationExpression
Public Sub New (type As CodeTypeReference, name As String)
參數
- type
- CodeTypeReference
物件,表示要宣告的參數型別。
- name
- String
要宣告的參數名稱。
適用於
.NET Framework 4.8.1 和其他版本
產品 | 版本 |
---|---|
.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 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |
使用指定的參數型別和名稱來初始化 CodeParameterDeclarationExpression 類別的新執行個體。
public:
CodeParameterDeclarationExpression(System::String ^ type, System::String ^ name);
public CodeParameterDeclarationExpression (string type, string name);
new System.CodeDom.CodeParameterDeclarationExpression : string * string -> System.CodeDom.CodeParameterDeclarationExpression
Public Sub New (type As String, name As String)
參數
- type
- String
要宣告的參數型別。
- name
- String
要宣告的參數名稱。
備註
type
如果參數參考泛型類型,則必須遵循泛型類型的語法慣例。 泛型型別的格式如下:類型的名稱,後面接著重音符號 (“'”) ,後面接著泛型類型自變數的計數,後面接著以括弧分隔的參數。
備註
您必須使用方括弧 ([]) ,而不是 C# 角括弧 () <> 分隔泛型參數。
若要避免發生語法錯誤的可能性,請考慮使用 CodeParameterDeclarationExpression(Type, String) 採用型別而非字串作為參數的建構函式。
適用於
.NET Framework 4.8.1 和其他版本
產品 | 版本 |
---|---|
.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 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |
使用指定的參數型別和名稱來初始化 CodeParameterDeclarationExpression 類別的新執行個體。
public:
CodeParameterDeclarationExpression(Type ^ type, System::String ^ name);
public CodeParameterDeclarationExpression (Type type, string name);
new System.CodeDom.CodeParameterDeclarationExpression : Type * string -> System.CodeDom.CodeParameterDeclarationExpression
Public Sub New (type As Type, name As String)
參數
- type
- Type
要宣告的參數型別。
- name
- String
要宣告的參數名稱。
適用於
.NET Framework 4.8.1 和其他版本
產品 | 版本 |
---|---|
.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 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |