CodeCommentStatementCollection.AddRange Method (CodeCommentStatement[])

 

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

Namespace:   System.CodeDom
Assembly:  System (in System.dll)

public void AddRange(
	CodeCommentStatement[] value
)

Parameters

value
Type: System.CodeDom.CodeCommentStatement[]

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

Exception Condition
ArgumentNullException

value is null.

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

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

.NET Framework
Available since 1.1
Return to top
Show: