CodeStatementCollection.Insert(Int32, CodeStatement) 方法
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將指定的 CodeStatement 物件插入至集合中所指定索引處。
public:
void Insert(int index, System::CodeDom::CodeStatement ^ value);
C#
public void Insert (int index, System.CodeDom.CodeStatement value);
member this.Insert : int * System.CodeDom.CodeStatement -> unit
Public Sub Insert (index As Integer, value As CodeStatement)
- index
- Int32
以零起始的索引,是應將指定物件插入的位置。
- value
- CodeStatement
要插入的 CodeStatement 物件。
下列範例示範如何使用 Insert 方法將 物件新增 CodeStatement 至 CodeStatementCollection。
// Inserts a CodeStatement at index 0 of the collection.
collection->Insert( 0, gcnew CodeCommentStatement( "Test comment statement" ) );
C#
// Inserts a CodeStatement at index 0 of the collection.
collection.Insert( 0, new CodeCommentStatement("Test comment statement") );
' Inserts a CodeStatement at index 0 of the collection.
collection.Insert(0, New CodeCommentStatement("Test comment statement"))
產品 | 版本 |
---|---|
.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 |