Share via


CodeCommentStatementCollection.AddRange Méthode

Définition

Copie les éléments du tableau CodeCommentStatement spécifié à la fin de la collection.

Surcharges

AddRange(CodeCommentStatement[])

Copie les éléments du tableau CodeCommentStatement spécifié à la fin de la collection.

AddRange(CodeCommentStatementCollection)

Copie le contenu d'un autre objet CodeCommentStatementCollection à la fin de la collection.

AddRange(CodeCommentStatement[])

Source:
CodeCommentStatementCollection.cs
Source:
CodeCommentStatementCollection.cs
Source:
CodeCommentStatementCollection.cs

Copie les éléments du tableau CodeCommentStatement spécifié à la fin de la collection.

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

Paramètres

value
CodeCommentStatement[]

Tableau de type CodeCommentStatement qui contient les objets à ajouter à la collection.

Exceptions

value a la valeur null.

Exemples

L’exemple suivant montre comment utiliser la AddRange(CodeCommentStatement[]) surcharge de méthode pour ajouter les membres d’un CodeCommentStatement tableau au CodeCommentStatementCollection.

// Adds an array of CodeCommentStatement objects to the collection.
array<CodeCommentStatement^>^comments = {gcnew CodeCommentStatement( "Test comment" ),gcnew CodeCommentStatement( "Another test comment" )};
collection->AddRange( comments );

// Adds a collection of CodeCommentStatement objects to the collection.
CodeCommentStatementCollection^ commentsCollection = gcnew CodeCommentStatementCollection;
commentsCollection->Add( gcnew CodeCommentStatement( "Test comment" ) );
commentsCollection->Add( gcnew CodeCommentStatement( "Another test comment" ) );
collection->AddRange( commentsCollection );
// 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)

Voir aussi

S’applique à

AddRange(CodeCommentStatementCollection)

Source:
CodeCommentStatementCollection.cs
Source:
CodeCommentStatementCollection.cs
Source:
CodeCommentStatementCollection.cs

Copie le contenu d'un autre objet CodeCommentStatementCollection à la fin de la collection.

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)

Paramètres

value
CodeCommentStatementCollection

CodeCommentStatementCollection qui contient les objets à ajouter à la collection.

Exceptions

value a la valeur null.

Exemples

L’exemple suivant montre comment utiliser la surcharge de AddRange(CodeCommentStatementCollection) méthode pour ajouter les membres de l’un à l’autre CodeCommentStatementCollection .

// Adds an array of CodeCommentStatement objects to the collection.
array<CodeCommentStatement^>^comments = {gcnew CodeCommentStatement( "Test comment" ),gcnew CodeCommentStatement( "Another test comment" )};
collection->AddRange( comments );

// Adds a collection of CodeCommentStatement objects to the collection.
CodeCommentStatementCollection^ commentsCollection = gcnew CodeCommentStatementCollection;
commentsCollection->Add( gcnew CodeCommentStatement( "Test comment" ) );
commentsCollection->Add( gcnew CodeCommentStatement( "Another test comment" ) );
collection->AddRange( commentsCollection );
// 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)

Voir aussi

S’applique à