Udostępnij za pośrednictwem


CodeTypeDeclarationCollection.AddRange Metoda

Definicja

Kopiuje elementy określonej tablicy na koniec kolekcji.

Przeciążenia

AddRange(CodeTypeDeclaration[])

Kopiuje elementy określonej tablicy na koniec kolekcji.

AddRange(CodeTypeDeclarationCollection)

Dodaje zawartość innego CodeTypeDeclarationCollection obiektu na końcu kolekcji.

AddRange(CodeTypeDeclaration[])

Źródło:
CodeTypeDeclarationCollection.cs
Źródło:
CodeTypeDeclarationCollection.cs
Źródło:
CodeTypeDeclarationCollection.cs

Kopiuje elementy określonej tablicy na koniec kolekcji.

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

Parametry

value
CodeTypeDeclaration[]

Tablica typu CodeTypeDeclaration zawierająca obiekty do dodania do kolekcji.

Wyjątki

value to null.

Przykłady

W poniższym przykładzie pokazano, jak za pomocą AddRange(CodeTypeDeclaration[]) przeciążenia metody dodać tablicę CodeTypeDeclaration obiektów do obiektu 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)

Zobacz też

Dotyczy

AddRange(CodeTypeDeclarationCollection)

Źródło:
CodeTypeDeclarationCollection.cs
Źródło:
CodeTypeDeclarationCollection.cs
Źródło:
CodeTypeDeclarationCollection.cs

Dodaje zawartość innego CodeTypeDeclarationCollection obiektu na końcu kolekcji.

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)

Parametry

value
CodeTypeDeclarationCollection

CodeTypeDeclarationCollection Obiekt zawierający obiekty do dodania do kolekcji.

Wyjątki

value to null.

Przykłady

W poniższym przykładzie pokazano, jak używać przeciążenia metody w celu dodania CodeTypeDeclaration obiektów z jednego CodeTypeDeclarationCollection do drugiego AddRange(CodeTypeDeclarationCollection)CodeTypeDeclarationCollectionelementu .

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

Zobacz też

Dotyczy