Condividi tramite


CodeTypeDeclarationCollection.AddRange Metodo

Definizione

Consente di copiare gli elementi della matrice specificata alla fine della raccolta.

Overload

AddRange(CodeTypeDeclaration[])

Consente di copiare gli elementi della matrice specificata alla fine della raccolta.

AddRange(CodeTypeDeclarationCollection)

Aggiunge il contenuto di un altro oggetto CodeTypeDeclarationCollection alla fine dell'insieme.

AddRange(CodeTypeDeclaration[])

Origine:
CodeTypeDeclarationCollection.cs
Origine:
CodeTypeDeclarationCollection.cs
Origine:
CodeTypeDeclarationCollection.cs

Consente di copiare gli elementi della matrice specificata alla fine della raccolta.

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

Parametri

value
CodeTypeDeclaration[]

Matrice di tipo CodeTypeDeclaration contenente gli oggetti da aggiungere all'insieme.

Eccezioni

value è null.

Esempio

Nell'esempio seguente viene illustrato come usare l'overload del AddRange(CodeTypeDeclaration[]) metodo per aggiungere una matrice di CodeTypeDeclaration oggetti a un oggetto 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)

Vedi anche

Si applica a

AddRange(CodeTypeDeclarationCollection)

Origine:
CodeTypeDeclarationCollection.cs
Origine:
CodeTypeDeclarationCollection.cs
Origine:
CodeTypeDeclarationCollection.cs

Aggiunge il contenuto di un altro oggetto CodeTypeDeclarationCollection alla fine dell'insieme.

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)

Parametri

value
CodeTypeDeclarationCollection

Oggetto CodeTypeDeclarationCollection contenente gli oggetti da aggiungere all'insieme.

Eccezioni

value è null.

Esempio

Nell'esempio seguente viene illustrato come usare l'overload del AddRange(CodeTypeDeclarationCollection) metodo per aggiungere CodeTypeDeclaration oggetti da uno CodeTypeDeclarationCollection a un altro 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)

Vedi anche

Si applica a