Auf Englisch lesen

Freigeben über


CodeCommentStatementCollection.AddRange Methode

Definition

Kopiert die Elemente des angegebenen CodeCommentStatement-Arrays an das Ende der Auflistung.

Überlädt

AddRange(CodeCommentStatement[])

Kopiert die Elemente des angegebenen CodeCommentStatement-Arrays an das Ende der Auflistung.

AddRange(CodeCommentStatementCollection)

Kopiert den Inhalt eines anderen CodeCommentStatementCollection-Objekts an das Ende der Auflistung.

AddRange(CodeCommentStatement[])

Quelle:
CodeCommentStatementCollection.cs
Quelle:
CodeCommentStatementCollection.cs
Quelle:
CodeCommentStatementCollection.cs

Kopiert die Elemente des angegebenen CodeCommentStatement-Arrays an das Ende der Auflistung.

public void AddRange (System.CodeDom.CodeCommentStatement[] value);

Parameter

value
CodeCommentStatement[]

Ein Array vom Typ CodeCommentStatement mit den Objekten, die der Auflistung hinzugefügt werden sollen.

Ausnahmen

value ist null.

Beispiele

Im folgenden Beispiel wird veranschaulicht, wie Sie mithilfe der AddRange(CodeCommentStatement[]) Methodenüberladung die Member eines CodeCommentStatement Arrays CodeCommentStatementCollectionhinzufügen.

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

Weitere Informationen

Gilt für:

AddRange(CodeCommentStatementCollection)

Quelle:
CodeCommentStatementCollection.cs
Quelle:
CodeCommentStatementCollection.cs
Quelle:
CodeCommentStatementCollection.cs

Kopiert den Inhalt eines anderen CodeCommentStatementCollection-Objekts an das Ende der Auflistung.

public void AddRange (System.CodeDom.CodeCommentStatementCollection value);

Parameter

value
CodeCommentStatementCollection

Eine CodeCommentStatementCollection, die die Objekte enthält, die der Auflistung hinzugefügt werden sollen.

Ausnahmen

value ist null.

Beispiele

Im folgenden Beispiel wird veranschaulicht, wie die AddRange(CodeCommentStatementCollection) Methodenüberladung verwendet wird, um die Member eines CodeCommentStatementCollection anderen hinzuzufügen.

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

Weitere Informationen

Gilt für: