Freigeben über


CodeTypeDeclarationCollection.AddRange Methode

Definition

Kopiert die Elemente des angegebenen Arrays an das Ende der Auflistung.

Überlädt

AddRange(CodeTypeDeclaration[])

Kopiert die Elemente des angegebenen Arrays an das Ende der Auflistung.

AddRange(CodeTypeDeclarationCollection)

Fügt den Inhalt eines anderen CodeTypeDeclarationCollection-Objekts am Ende der Auflistung hinzu.

AddRange(CodeTypeDeclaration[])

Quelle:
CodeTypeDeclarationCollection.cs
Quelle:
CodeTypeDeclarationCollection.cs
Quelle:
CodeTypeDeclarationCollection.cs

Kopiert die Elemente des angegebenen Arrays an das Ende der Auflistung.

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

Parameter

value
CodeTypeDeclaration[]

Ein Array vom Typ CodeTypeDeclaration mit den Objekten, die der Auflistung hinzugefügt werden sollen.

Ausnahmen

value ist null.

Beispiele

Im folgenden Beispiel wird veranschaulicht, wie Sie mithilfe der AddRange(CodeTypeDeclaration[]) Methodenüberladung ein Array von CodeTypeDeclaration -Objekten zu einem CodeTypeDeclarationCollectionhinzufügen.

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

Weitere Informationen

Gilt für:

AddRange(CodeTypeDeclarationCollection)

Quelle:
CodeTypeDeclarationCollection.cs
Quelle:
CodeTypeDeclarationCollection.cs
Quelle:
CodeTypeDeclarationCollection.cs

Fügt den Inhalt eines anderen CodeTypeDeclarationCollection-Objekts am Ende der Auflistung hinzu.

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)

Parameter

value
CodeTypeDeclarationCollection

Ein CodeTypeDeclarationCollection-Objekt, das die Objekte enthält, die der Auflistung hinzugefügt werden sollen.

Ausnahmen

value ist null.

Beispiele

Im folgenden Beispiel wird veranschaulicht, wie Sie mithilfe der AddRange(CodeTypeDeclarationCollection) Methodenüberladung Objekte aus einem CodeTypeDeclarationCollection anderen CodeTypeDeclarationCollectionhinzufügenCodeTypeDeclaration.

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

Weitere Informationen

Gilt für: