CodeExpressionCollection.AddRange 方法

定义

将指定数组的元素复制到该集合的末尾。

重载

AddRange(CodeExpression[])

将指定数组的元素复制到该集合的末尾。

AddRange(CodeExpressionCollection)

将另一个 CodeExpressionCollection 对象的内容复制到集合的末尾。

AddRange(CodeExpression[])

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

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

另请参阅

适用于