CodeStatementCollection.Add 方法

定義

將指定的 CodeStatement 加入至集合。

多載

Add(CodeExpression)

將指定的 CodeExpression 物件加入至集合。

Add(CodeStatement)

將指定的 CodeStatement 物件加入至集合。

Add(CodeExpression)

來源:
CodeStatementCollection.cs
來源:
CodeStatementCollection.cs
來源:
CodeStatementCollection.cs

將指定的 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)

來源:
CodeStatementCollection.cs
來源:
CodeStatementCollection.cs
來源:
CodeStatementCollection.cs

將指定的 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( gcnew CodeCommentStatement( "Test comment statement" ) );
// 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"))

另請參閱

適用於