CodeStatementCollection.Add 方法

定义

将指定的 CodeStatement 值添加到集合中。

重载

名称 说明
Add(CodeExpression)

将指定的 CodeExpression 对象添加到集合中。

Add(CodeStatement)

将指定的 CodeStatement 对象添加到集合中。

Add(CodeExpression)

Source:
CodeStatementCollection.cs
Source:
CodeStatementCollection.cs
Source:
CodeStatementCollection.cs
Source:
CodeStatementCollection.cs
Source:
CodeStatementCollection.cs
Source:
CodeStatementCollection.cs
Source:
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)

Source:
CodeStatementCollection.cs
Source:
CodeStatementCollection.cs
Source:
CodeStatementCollection.cs
Source:
CodeStatementCollection.cs
Source:
CodeStatementCollection.cs
Source:
CodeStatementCollection.cs
Source:
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( new CodeCommentStatement("Test comment statement") );
' Adds a CodeStatement to the collection.
collection.Add(New CodeCommentStatement("Test comment statement"))

另请参阅

适用于