CodeStatementCollection.Add 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將指定的 CodeStatement 資料加入集合。
多載
| 名稱 | Description |
|---|---|
| Add(CodeExpression) |
將指定的 CodeExpression 物件加入集合中。 |
| Add(CodeStatement) |
將指定的 CodeStatement 物件加入集合中。 |
Add(CodeExpression)
將指定的 CodeExpression 物件加入集合中。
public:
int Add(System::CodeDom::CodeExpression ^ value);
public int Add(System.CodeDom.CodeExpression value);
member this.Add : System.CodeDom.CodeExpression -> int
Public Function Add (value As CodeExpression) As Integer
參數
- value
- CodeExpression
CodeExpression要補充的目標。
傳回
新元素插入的索引。
另請參閱
適用於
Add(CodeStatement)
將指定的 CodeStatement 物件加入集合中。
public:
int Add(System::CodeDom::CodeStatement ^ value);
public int Add(System.CodeDom.CodeStatement value);
member this.Add : System.CodeDom.CodeStatement -> int
Public Function Add (value As CodeStatement) As Integer
參數
- value
- CodeStatement
CodeStatement要補充的目標。
傳回
新元素插入的索引。
範例
以下範例示範如何將物件加入CodeStatementCodeStatementCollection實例。
// Adds a CodeStatement to the collection.
collection.Add( new CodeCommentStatement("Test comment statement") );
' Adds a CodeStatement to the collection.
collection.Add(New CodeCommentStatement("Test comment statement"))