CodeTypeDeclarationCollection.AddRange Método
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Copia os elementos da matriz especificada para o fim da coleção.
Sobrecargas
AddRange(CodeTypeDeclaration[]) |
Copia os elementos da matriz especificada para o fim da coleção. |
AddRange(CodeTypeDeclarationCollection) |
Adiciona o conteúdo de outro objeto CodeTypeDeclarationCollection ao final da coleção. |
AddRange(CodeTypeDeclaration[])
Copia os elementos da matriz especificada para o fim da coleção.
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[]
Uma matriz do tipo CodeTypeDeclaration que contém os objetos a serem adicionados à coleção.
Exceções
value
é null
.
Exemplos
O exemplo a seguir demonstra como usar a sobrecarga de AddRange(CodeTypeDeclaration[]) método para adicionar uma matriz de CodeTypeDeclaration objetos a um 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)
Confira também
Aplica-se a
AddRange(CodeTypeDeclarationCollection)
Adiciona o conteúdo de outro objeto CodeTypeDeclarationCollection ao final da coleção.
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
Um objeto CodeTypeDeclarationCollection que contém os objetos a serem adicionados à coleção.
Exceções
value
é null
.
Exemplos
O exemplo a seguir demonstra como usar a sobrecarga de AddRange(CodeTypeDeclarationCollection) método para adicionar CodeTypeDeclaration objetos de um CodeTypeDeclarationCollection a outro 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)