共用方式為


CodeExpressionCollection.AddRange 方法

定義

將指定的陣列元素複製到集合末端。

多載

AddRange(CodeExpression[])

將指定的陣列元素複製到集合末端。

AddRange(CodeExpressionCollection)

將另一個 CodeExpressionCollection 物件的內容複製到集合的結尾。

AddRange(CodeExpression[])

來源:
CodeExpressionCollection.cs
來源:
CodeExpressionCollection.cs
來源:
CodeExpressionCollection.cs

將指定的陣列元素複製到集合末端。

public:
 void AddRange(cli::array <System::CodeDom::CodeExpression ^> ^ value);
public void AddRange (System.CodeDom.CodeExpression[] value);
member this.AddRange : System.CodeDom.CodeExpression[] -> unit
Public Sub AddRange (value As CodeExpression())

參數

value
CodeExpression[]

CodeExpression 型別的陣列,包含要加入至集合的物件。

例外狀況

valuenull

範例

下列範例示範如何使用 AddRange(CodeExpression[]) 方法多載,將陣列的成員 CodeExpression 新增至 CodeExpressionCollection

// Adds an array of CodeExpression objects to the collection.
array<CodeExpression^>^expressions = {gcnew CodePrimitiveExpression( true ),gcnew CodePrimitiveExpression( true )};
collection->AddRange( expressions );

// Adds a collection of CodeExpression objects to the collection.
CodeExpressionCollection^ expressionsCollection = gcnew CodeExpressionCollection;
expressionsCollection->Add( gcnew CodePrimitiveExpression( true ) );
expressionsCollection->Add( gcnew CodePrimitiveExpression( true ) );
collection->AddRange( expressionsCollection );
// Adds an array of CodeExpression objects to the collection.
CodeExpression[] expressions = { new CodePrimitiveExpression(true), new CodePrimitiveExpression(true) };
collection.AddRange( expressions );

// Adds a collection of CodeExpression objects to the collection.
CodeExpressionCollection expressionsCollection = new CodeExpressionCollection();
expressionsCollection.Add( new CodePrimitiveExpression(true) );
expressionsCollection.Add( new CodePrimitiveExpression(true) );
collection.AddRange( expressionsCollection );
' Adds an array of CodeExpression objects to the collection.
Dim expressions As CodeExpression() = {New CodePrimitiveExpression(True), New CodePrimitiveExpression(True)}
collection.AddRange(expressions)

' Adds a collection of CodeExpression objects to the collection.
Dim expressionsCollection As New CodeExpressionCollection()
expressionsCollection.Add(New CodePrimitiveExpression(True))
expressionsCollection.Add(New CodePrimitiveExpression(True))
collection.AddRange(expressionsCollection)

另請參閱

適用於

AddRange(CodeExpressionCollection)

來源:
CodeExpressionCollection.cs
來源:
CodeExpressionCollection.cs
來源:
CodeExpressionCollection.cs

將另一個 CodeExpressionCollection 物件的內容複製到集合的結尾。

public:
 void AddRange(System::CodeDom::CodeExpressionCollection ^ value);
public void AddRange (System.CodeDom.CodeExpressionCollection value);
member this.AddRange : System.CodeDom.CodeExpressionCollection -> unit
Public Sub AddRange (value As CodeExpressionCollection)

參數

value
CodeExpressionCollection

CodeExpressionCollection,包含要加入至集合的物件。

例外狀況

valuenull

範例

下列範例示範如何使用 AddRange(CodeExpressionCollection) 方法多載,將某個對象的成員加入另一個 CodeExpressionCollectionCodeExpressionCollection物件。

// Adds an array of CodeExpression objects to the collection.
array<CodeExpression^>^expressions = {gcnew CodePrimitiveExpression( true ),gcnew CodePrimitiveExpression( true )};
collection->AddRange( expressions );

// Adds a collection of CodeExpression objects to the collection.
CodeExpressionCollection^ expressionsCollection = gcnew CodeExpressionCollection;
expressionsCollection->Add( gcnew CodePrimitiveExpression( true ) );
expressionsCollection->Add( gcnew CodePrimitiveExpression( true ) );
collection->AddRange( expressionsCollection );
// Adds an array of CodeExpression objects to the collection.
CodeExpression[] expressions = { new CodePrimitiveExpression(true), new CodePrimitiveExpression(true) };
collection.AddRange( expressions );

// Adds a collection of CodeExpression objects to the collection.
CodeExpressionCollection expressionsCollection = new CodeExpressionCollection();
expressionsCollection.Add( new CodePrimitiveExpression(true) );
expressionsCollection.Add( new CodePrimitiveExpression(true) );
collection.AddRange( expressionsCollection );
' Adds an array of CodeExpression objects to the collection.
Dim expressions As CodeExpression() = {New CodePrimitiveExpression(True), New CodePrimitiveExpression(True)}
collection.AddRange(expressions)

' Adds a collection of CodeExpression objects to the collection.
Dim expressionsCollection As New CodeExpressionCollection()
expressionsCollection.Add(New CodePrimitiveExpression(True))
expressionsCollection.Add(New CodePrimitiveExpression(True))
collection.AddRange(expressionsCollection)

另請參閱

適用於