CodeCommentStatementCollection.AddRange 方法

定義

將指定 CodeCommentStatement 陣列的元素複製到集合的末尾。

多載

名稱 Description
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 A 包含要加入集合的物件。

例外狀況

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)

另請參閱

適用於