CodeParameterDeclarationExpression 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
初始化 CodeParameterDeclarationExpression 類別的新執行個體。
多載
| 名稱 | Description |
|---|---|
| CodeParameterDeclarationExpression() |
初始化 CodeParameterDeclarationExpression 類別的新執行個體。 |
| CodeParameterDeclarationExpression(CodeTypeReference, String) |
使用指定的參數類型與名稱初始化類別的新實例 CodeParameterDeclarationExpression 。 |
| CodeParameterDeclarationExpression(String, String) |
使用指定的參數類型與名稱初始化類別的新實例 CodeParameterDeclarationExpression 。 |
| CodeParameterDeclarationExpression(Type, String) |
使用指定的參數類型與名稱初始化類別的新實例 CodeParameterDeclarationExpression 。 |
CodeParameterDeclarationExpression()
初始化 CodeParameterDeclarationExpression 類別的新執行個體。
public:
CodeParameterDeclarationExpression();
public CodeParameterDeclarationExpression();
Public Sub New ()
適用於
CodeParameterDeclarationExpression(CodeTypeReference, String)
使用指定的參數類型與名稱初始化類別的新實例 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
要宣告的參數名稱。
適用於
CodeParameterDeclarationExpression(String, String)
使用指定的參數類型與名稱初始化類別的新實例 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 參考泛型,則必須遵循泛型型別的語法慣例。 泛型型別格式如下:型別名稱,後接重音符號(“'”),接著是通用型別參數的計數,最後是以括號分隔的參數。
Note
你必須用方括號([])來界定一般參數,而不是 C# 的角括號(<>)。
為避免語法錯誤,建議使用 CodeParameterDeclarationExpression(Type, String) 以型別為參數而非字串的構造子。
適用於
CodeParameterDeclarationExpression(Type, String)
使用指定的參數類型與名稱初始化類別的新實例 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
要宣告的參數名稱。