CodeCommentStatementCollection.AddRange Methode

Definitie

Kopieert de elementen van de opgegeven CodeCommentStatement matrix naar het einde van de verzameling.

Overloads

Name Description
AddRange(CodeCommentStatement[])

Kopieert de elementen van de opgegeven CodeCommentStatement matrix naar het einde van de verzameling.

AddRange(CodeCommentStatementCollection)

Hiermee kopieert u de inhoud van een ander CodeCommentStatementCollection object naar het einde van de verzameling.

AddRange(CodeCommentStatement[])

Kopieert de elementen van de opgegeven CodeCommentStatement matrix naar het einde van de verzameling.

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

Parameters

value
CodeCommentStatement[]

Een matrix van het type CodeCommentStatement dat de objecten bevat die aan de verzameling moeten worden toegevoegd.

Uitzonderingen

value is null.

Voorbeelden

In het volgende voorbeeld ziet u hoe u de overbelasting van de AddRange(CodeCommentStatement[]) methode gebruikt om de leden van een CodeCommentStatement matrix toe te voegen aan de 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)

Zie ook

Van toepassing op

AddRange(CodeCommentStatementCollection)

Hiermee kopieert u de inhoud van een ander CodeCommentStatementCollection object naar het einde van de verzameling.

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)

Parameters

value
CodeCommentStatementCollection

Een CodeCommentStatementCollection met de objecten die moeten worden toegevoegd aan de verzameling.

Uitzonderingen

value is null.

Voorbeelden

In het volgende voorbeeld ziet u hoe u de overbelasting van de AddRange(CodeCommentStatementCollection) methode gebruikt om de leden van elkaar CodeCommentStatementCollection toe te voegen.

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

Zie ook

Van toepassing op