CodeTypeDeclarationCollection.AddRange CodeTypeDeclarationCollection.AddRange CodeTypeDeclarationCollection.AddRange CodeTypeDeclarationCollection.AddRange Method

Определение

Копирует элементы указанного массива в конец коллекции.Copies the elements of the specified array to the end of the collection.

Перегрузки

AddRange(CodeTypeDeclaration[]) AddRange(CodeTypeDeclaration[]) AddRange(CodeTypeDeclaration[]) AddRange(CodeTypeDeclaration[])

Копирует элементы указанного массива в конец коллекции.Copies the elements of the specified array to the end of the collection.

AddRange(CodeTypeDeclarationCollection) AddRange(CodeTypeDeclarationCollection) AddRange(CodeTypeDeclarationCollection) AddRange(CodeTypeDeclarationCollection)

Добавляет содержимое другого объекта CodeTypeDeclarationCollection в конец коллекции.Adds the contents of another CodeTypeDeclarationCollection object to the end of the collection.

AddRange(CodeTypeDeclaration[]) AddRange(CodeTypeDeclaration[]) AddRange(CodeTypeDeclaration[]) AddRange(CodeTypeDeclaration[])

Копирует элементы указанного массива в конец коллекции.Copies the elements of the specified array to the end of the collection.

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

Параметры

value
CodeTypeDeclaration[]

Массив типа CodeTypeDeclaration, содержащий объекты, добавляемые в коллекцию.An array of type CodeTypeDeclaration that contains the objects to add to the collection.

Исключения

Примеры

В следующем примере показано, как использовать AddRange(CodeTypeDeclaration[]) перегрузку метода для добавления CodeTypeDeclaration массива объектов в CodeTypeDeclarationCollection.The following example demonstrates how to use the AddRange(CodeTypeDeclaration[]) method overload to add an array of CodeTypeDeclaration objects to 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)
Дополнительно

AddRange(CodeTypeDeclarationCollection) AddRange(CodeTypeDeclarationCollection) AddRange(CodeTypeDeclarationCollection) AddRange(CodeTypeDeclarationCollection)

Добавляет содержимое другого объекта CodeTypeDeclarationCollection в конец коллекции.Adds the contents of another CodeTypeDeclarationCollection object to the end of the collection.

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)

Параметры

value
CodeTypeDeclarationCollection CodeTypeDeclarationCollection CodeTypeDeclarationCollection CodeTypeDeclarationCollection

Объект CodeTypeDeclarationCollection, содержащий объекты, добавляемые в коллекцию.A CodeTypeDeclarationCollection object that contains the objects to add to the collection.

Исключения

Свойство value имеет значение null.value is null.

Примеры

В следующем примере показано, как AddRange(CodeTypeDeclarationCollection) использовать перегрузку метода для добавления CodeTypeDeclaration объектов из CodeTypeDeclarationCollection одного в CodeTypeDeclarationCollectionдругой.The following example demonstrates how to use the AddRange(CodeTypeDeclarationCollection) method overload to add CodeTypeDeclaration objects from one CodeTypeDeclarationCollection to another 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)
Дополнительно

Применяется к