CodeTypeDeclarationCollection.AddRange Method

Definition

Copies the elements of the specified array to the end of the collection.

Overloads

AddRange(CodeTypeDeclaration[])

Copies the elements of the specified array to the end of the collection.

AddRange(CodeTypeDeclarationCollection)

Adds the contents of another CodeTypeDeclarationCollection object to the end of the collection.

AddRange(CodeTypeDeclaration[])

Source:
CodeTypeDeclarationCollection.cs
Source:
CodeTypeDeclarationCollection.cs
Source:
CodeTypeDeclarationCollection.cs
Source:
CodeTypeDeclarationCollection.cs
Source:
CodeTypeDeclarationCollection.cs

Copies the elements of the specified array to the end of the collection.

C#
public void AddRange(System.CodeDom.CodeTypeDeclaration[] value);

Parameters

value
CodeTypeDeclaration[]

An array of type CodeTypeDeclaration that contains the objects to add to the collection.

Exceptions

value is null.

Examples

The following example demonstrates how to use the AddRange(CodeTypeDeclaration[]) method overload to add an array of CodeTypeDeclaration objects to a CodeTypeDeclarationCollection.

C#
// 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 );

See also

Applies to

.NET 10 (package-provided) ja muut versiot
Tuote Versiot
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

AddRange(CodeTypeDeclarationCollection)

Source:
CodeTypeDeclarationCollection.cs
Source:
CodeTypeDeclarationCollection.cs
Source:
CodeTypeDeclarationCollection.cs
Source:
CodeTypeDeclarationCollection.cs
Source:
CodeTypeDeclarationCollection.cs

Adds the contents of another CodeTypeDeclarationCollection object to the end of the collection.

C#
public void AddRange(System.CodeDom.CodeTypeDeclarationCollection value);

Parameters

value
CodeTypeDeclarationCollection

A CodeTypeDeclarationCollection object that contains the objects to add to the collection.

Exceptions

value is null.

Examples

The following example demonstrates how to use the AddRange(CodeTypeDeclarationCollection) method overload to add CodeTypeDeclaration objects from one CodeTypeDeclarationCollection to another CodeTypeDeclarationCollection.

C#
// 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 );

See also

Applies to

.NET 10 (package-provided) ja muut versiot
Tuote Versiot
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10