CodeExpressionCollection.CopyTo(CodeExpression[], Int32) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將集合物件複製到從指定索引開始的一維 Array 實例。
public:
void CopyTo(cli::array <System::CodeDom::CodeExpression ^> ^ array, int index);
public void CopyTo(System.CodeDom.CodeExpression[] array, int index);
member this.CopyTo : System.CodeDom.CodeExpression[] * int -> unit
Public Sub CopyTo (array As CodeExpression(), index As Integer)
參數
- array
- CodeExpression[]
一維 Array 值是從集合複製的值的目的地。
- index
- Int32
開始插入的陣列索引。
例外狀況
參數 array 為 null。
參數 index 小於目標陣列的最小索引。
範例
以下範例示範如何將 a CodeExpressionCollection 的內容複製到從索引值 0 開始的 CodeExpression 陣列。
// Copies the contents of the collection beginning at index 0 to the specified CodeExpression array.
// 'expressions' is a CodeExpression array.
collection.CopyTo( expressions, 0 );
' Copies the contents of the collection beginning at index 0 to the specified CodeExpression array.
' 'expressions' is a CodeExpression array.
collection.CopyTo(expressions, 0)