Editare

Partajați prin


CodeExpressionCollection.AddRange Method

Definition

Copies the elements of the specified array to the end of the collection.

Overloads

AddRange(CodeExpression[])

Copies the elements of the specified array to the end of the collection.

AddRange(CodeExpressionCollection)

Copies the contents of another CodeExpressionCollection object to the end of the collection.

AddRange(CodeExpression[])

Source:
CodeExpressionCollection.cs
Source:
CodeExpressionCollection.cs
Source:
CodeExpressionCollection.cs
Source:
CodeExpressionCollection.cs

Copies the elements of the specified array to the end of the collection.

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())

Parameters

value
CodeExpression[]

An array of type CodeExpression that contains the objects to add to the collection.

Exceptions

value is null.

Examples

The following example demonstrates how to use the AddRange(CodeExpression[]) method overload to add the members of a CodeExpression array to a 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)

See also

Applies to

AddRange(CodeExpressionCollection)

Source:
CodeExpressionCollection.cs
Source:
CodeExpressionCollection.cs
Source:
CodeExpressionCollection.cs
Source:
CodeExpressionCollection.cs

Copies the contents of another CodeExpressionCollection object to the end of the collection.

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)

Parameters

value
CodeExpressionCollection

A CodeExpressionCollection that contains the objects to add to the collection.

Exceptions

value is null.

Examples

The following example demonstrates how to use the AddRange(CodeExpressionCollection) method overload to add the members of one CodeExpressionCollection object to another 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)

See also

Applies to