Compartir vía


CodeTypeDeclarationCollection.AddRange Método

Definición

Copia los elementos de la matriz especificada al final de la colección.

Sobrecargas

AddRange(CodeTypeDeclaration[])

Copia los elementos de la matriz especificada al final de la colección.

AddRange(CodeTypeDeclarationCollection)

Agrega el contenido de otro objeto CodeTypeDeclarationCollection al final de la colección.

AddRange(CodeTypeDeclaration[])

Source:
CodeTypeDeclarationCollection.cs
Source:
CodeTypeDeclarationCollection.cs
Source:
CodeTypeDeclarationCollection.cs

Copia los elementos de la matriz especificada al final de la colección.

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

Parámetros

value
CodeTypeDeclaration[]

Matriz de tipo CodeTypeDeclaration que contiene los objetos que se van a agregar a la colección.

Excepciones

value es null.

Ejemplos

En el ejemplo siguiente se muestra cómo usar la sobrecarga del AddRange(CodeTypeDeclaration[]) método para agregar una matriz de CodeTypeDeclaration objetos a .CodeTypeDeclarationCollection

// Adds an array of CodeTypeDeclaration objects to the collection.
array<CodeTypeDeclaration^>^declarations = {gcnew CodeTypeDeclaration( "TestType1" ),gcnew CodeTypeDeclaration( "TestType2" )};
collection->AddRange( declarations );

// Adds a collection of CodeTypeDeclaration objects to the 
// collection.
CodeTypeDeclarationCollection^ declarationsCollection = gcnew CodeTypeDeclarationCollection;
declarationsCollection->Add( gcnew CodeTypeDeclaration( "TestType1" ) );
declarationsCollection->Add( gcnew CodeTypeDeclaration( "TestType2" ) );
collection->AddRange( declarationsCollection );
// Adds an array of CodeTypeDeclaration objects to the collection.
CodeTypeDeclaration[] declarations = { new CodeTypeDeclaration("TestType1"), new CodeTypeDeclaration("TestType2") };
collection.AddRange( declarations );

// Adds a collection of CodeTypeDeclaration objects to the
// collection.
CodeTypeDeclarationCollection declarationsCollection = new CodeTypeDeclarationCollection();
declarationsCollection.Add( new CodeTypeDeclaration("TestType1") );
declarationsCollection.Add( new CodeTypeDeclaration("TestType2") );
collection.AddRange( declarationsCollection );
' Adds an array of CodeTypeDeclaration objects to the 
' collection.
Dim declarations As CodeTypeDeclaration() = {New CodeTypeDeclaration("TestType1"), New CodeTypeDeclaration("TestType2")}
collection.AddRange(declarations)

' Adds a collection of CodeTypeDeclaration objects to the collection.
Dim declarationsCollection As New CodeTypeDeclarationCollection()
declarationsCollection.Add(New CodeTypeDeclaration("TestType1"))
declarationsCollection.Add(New CodeTypeDeclaration("TestType2"))
collection.AddRange(declarationsCollection)

Consulte también

Se aplica a

AddRange(CodeTypeDeclarationCollection)

Source:
CodeTypeDeclarationCollection.cs
Source:
CodeTypeDeclarationCollection.cs
Source:
CodeTypeDeclarationCollection.cs

Agrega el contenido de otro objeto CodeTypeDeclarationCollection al final de la colección.

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

Parámetros

value
CodeTypeDeclarationCollection

Objeto CodeTypeDeclarationCollection que contiene los objetos que se van a agregar a la colección.

Excepciones

value es null.

Ejemplos

En el ejemplo siguiente se muestra cómo usar la sobrecarga del AddRange(CodeTypeDeclarationCollection) método para agregar CodeTypeDeclaration objetos de uno CodeTypeDeclarationCollection a otro CodeTypeDeclarationCollection.

// Adds an array of CodeTypeDeclaration objects to the collection.
array<CodeTypeDeclaration^>^declarations = {gcnew CodeTypeDeclaration( "TestType1" ),gcnew CodeTypeDeclaration( "TestType2" )};
collection->AddRange( declarations );

// Adds a collection of CodeTypeDeclaration objects to the 
// collection.
CodeTypeDeclarationCollection^ declarationsCollection = gcnew CodeTypeDeclarationCollection;
declarationsCollection->Add( gcnew CodeTypeDeclaration( "TestType1" ) );
declarationsCollection->Add( gcnew CodeTypeDeclaration( "TestType2" ) );
collection->AddRange( declarationsCollection );
// Adds an array of CodeTypeDeclaration objects to the collection.
CodeTypeDeclaration[] declarations = { new CodeTypeDeclaration("TestType1"), new CodeTypeDeclaration("TestType2") };
collection.AddRange( declarations );

// Adds a collection of CodeTypeDeclaration objects to the
// collection.
CodeTypeDeclarationCollection declarationsCollection = new CodeTypeDeclarationCollection();
declarationsCollection.Add( new CodeTypeDeclaration("TestType1") );
declarationsCollection.Add( new CodeTypeDeclaration("TestType2") );
collection.AddRange( declarationsCollection );
' Adds an array of CodeTypeDeclaration objects to the 
' collection.
Dim declarations As CodeTypeDeclaration() = {New CodeTypeDeclaration("TestType1"), New CodeTypeDeclaration("TestType2")}
collection.AddRange(declarations)

' Adds a collection of CodeTypeDeclaration objects to the collection.
Dim declarationsCollection As New CodeTypeDeclarationCollection()
declarationsCollection.Add(New CodeTypeDeclaration("TestType1"))
declarationsCollection.Add(New CodeTypeDeclaration("TestType2"))
collection.AddRange(declarationsCollection)

Consulte también

Se aplica a