CodeCommentStatementCollection.AddRange Metoda

Definicja

Kopiuje elementy określonej CodeCommentStatement tablicy na końcu kolekcji.

Przeciążenia

Nazwa Opis
AddRange(CodeCommentStatement[])

Kopiuje elementy określonej CodeCommentStatement tablicy na końcu kolekcji.

AddRange(CodeCommentStatementCollection)

Kopiuje zawartość innego CodeCommentStatementCollection obiektu na końcu kolekcji.

AddRange(CodeCommentStatement[])

Kopiuje elementy określonej CodeCommentStatement tablicy na końcu kolekcji.

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())

Parametry

value
CodeCommentStatement[]

Tablica typu CodeCommentStatement zawierająca obiekty do dodania do kolekcji.

Wyjątki

Parametr value ma wartość null.

Przykłady

W poniższym przykładzie pokazano, jak używać AddRange(CodeCommentStatement[]) przeciążenia metody w celu dodania elementów członkowskich CodeCommentStatement tablicy do CodeCommentStatementCollectionobiektu .

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

Zobacz też

Dotyczy

AddRange(CodeCommentStatementCollection)

Kopiuje zawartość innego CodeCommentStatementCollection obiektu na końcu kolekcji.

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)

Parametry

value
CodeCommentStatementCollection

Obiekt CodeCommentStatementCollection zawierający obiekty do dodania do kolekcji.

Wyjątki

Parametr value ma wartość null.

Przykłady

W poniższym przykładzie pokazano, jak używać AddRange(CodeCommentStatementCollection) przeciążenia metody w celu dodania CodeCommentStatementCollection do siebie elementów członkowskich.

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

Zobacz też

Dotyczy