CodeCommentStatementCollection.AddRange 方法

定义

将指定 CodeCommentStatement 数组的元素复制到集合的末尾。

重载

名称 说明
AddRange(CodeCommentStatement[])

将指定 CodeCommentStatement 数组的元素复制到集合的末尾。

AddRange(CodeCommentStatementCollection)

将另一个 CodeCommentStatementCollection 对象的内容复制到集合的末尾。

AddRange(CodeCommentStatement[])

将指定 CodeCommentStatement 数组的元素复制到集合的末尾。

public:
 void AddRange(cli::array <System::CodeDom::CodeCommentStatement ^> ^ value);
public void AddRange(System.CodeDom.CodeCommentStatement[] value);
member this.AddRange : System.CodeDom.CodeCommentStatement[] -> unit
Public Sub AddRange (value As CodeCommentStatement())

参数

value
CodeCommentStatement[]

包含要添加到集合中的对象的类型的 CodeCommentStatement 数组。

例外

valuenull

示例

下面的示例演示如何使用 AddRange(CodeCommentStatement[]) 方法重载将数组的成员 CodeCommentStatement 添加到数组中 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 );
' Adds an array of CodeCommentStatement objects to the collection.
Dim comments As CodeCommentStatement() = {New CodeCommentStatement("Test comment"), New CodeCommentStatement("Another test comment")}
collection.AddRange(comments)

' Adds a collection of CodeCommentStatement objects to the 
' collection.
Dim commentsCollection As New CodeCommentStatementCollection()
commentsCollection.Add(New CodeCommentStatement("Test comment"))
commentsCollection.Add(New CodeCommentStatement("Another test comment"))
collection.AddRange(commentsCollection)

另请参阅

适用于

AddRange(CodeCommentStatementCollection)

将另一个 CodeCommentStatementCollection 对象的内容复制到集合的末尾。

public:
 void AddRange(System::CodeDom::CodeCommentStatementCollection ^ value);
public void AddRange(System.CodeDom.CodeCommentStatementCollection value);
member this.AddRange : System.CodeDom.CodeCommentStatementCollection -> unit
Public Sub AddRange (value As CodeCommentStatementCollection)

参数

value
CodeCommentStatementCollection

一个 CodeCommentStatementCollection 包含要添加到集合的对象。

例外

valuenull

示例

以下示例演示如何使用 AddRange(CodeCommentStatementCollection) 方法重载将彼此的成员添加到另一个 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 );
' Adds an array of CodeCommentStatement objects to the collection.
Dim comments As CodeCommentStatement() = {New CodeCommentStatement("Test comment"), New CodeCommentStatement("Another test comment")}
collection.AddRange(comments)

' Adds a collection of CodeCommentStatement objects to the 
' collection.
Dim commentsCollection As New CodeCommentStatementCollection()
commentsCollection.Add(New CodeCommentStatement("Test comment"))
commentsCollection.Add(New CodeCommentStatement("Another test comment"))
collection.AddRange(commentsCollection)

另请参阅

适用于