Прочетете на английски Редактиране

Споделяне чрез


CodeCommentStatementCollection.AddRange Method

Definition

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

Overloads

AddRange(CodeCommentStatement[])

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

AddRange(CodeCommentStatementCollection)

Copies the contents of another CodeCommentStatementCollection object to the end of the collection.

AddRange(CodeCommentStatement[])

Source:
CodeCommentStatementCollection.cs
Source:
CodeCommentStatementCollection.cs
Source:
CodeCommentStatementCollection.cs
Source:
CodeCommentStatementCollection.cs
Source:
CodeCommentStatementCollection.cs

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

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

Parameters

value
CodeCommentStatement[]

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

Exceptions

value is null.

Examples

The following example demonstrates how to use the AddRange(CodeCommentStatement[]) method overload to add the members of a CodeCommentStatement array to the CodeCommentStatementCollection.

C#
// Adds an array of CodeCommentStatement objects to the collection.
CodeCommentStatement[] comments = { new CodeCommentStatement("Test comment"), new CodeCommentStatement("Another test comment") };
collection.AddRange( comments );

// Adds a collection of CodeCommentStatement objects to the collection.
CodeCommentStatementCollection commentsCollection = new CodeCommentStatementCollection();
commentsCollection.Add( new CodeCommentStatement("Test comment") );
commentsCollection.Add( new CodeCommentStatement("Another test comment") );
collection.AddRange( commentsCollection );

See also

Applies to

.NET 10 (package-provided) и други версии
Продукт Версии
.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(CodeCommentStatementCollection)

Source:
CodeCommentStatementCollection.cs
Source:
CodeCommentStatementCollection.cs
Source:
CodeCommentStatementCollection.cs
Source:
CodeCommentStatementCollection.cs
Source:
CodeCommentStatementCollection.cs

Copies the contents of another CodeCommentStatementCollection object to the end of the collection.

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

Parameters

value
CodeCommentStatementCollection

A CodeCommentStatementCollection that contains the objects to add to the collection.

Exceptions

value is null.

Examples

The following example demonstrates how to use the AddRange(CodeCommentStatementCollection) method overload to add the members of one CodeCommentStatementCollection to another.

C#
// Adds an array of CodeCommentStatement objects to the collection.
CodeCommentStatement[] comments = { new CodeCommentStatement("Test comment"), new CodeCommentStatement("Another test comment") };
collection.AddRange( comments );

// Adds a collection of CodeCommentStatement objects to the collection.
CodeCommentStatementCollection commentsCollection = new CodeCommentStatementCollection();
commentsCollection.Add( new CodeCommentStatement("Test comment") );
commentsCollection.Add( new CodeCommentStatement("Another test comment") );
collection.AddRange( commentsCollection );

See also

Applies to

.NET 10 (package-provided) и други версии
Продукт Версии
.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