Partilhar via


CodeCommentStatementCollection.AddRange Método

Definição

Copia os elementos da matriz CodeCommentStatement especificada para o fim da coleção.

Sobrecargas

AddRange(CodeCommentStatement[])

Copia os elementos da matriz CodeCommentStatement especificada para o fim da coleção.

AddRange(CodeCommentStatementCollection)

Copia o conteúdo de outro objeto CodeCommentStatementCollection para o final da coleção.

AddRange(CodeCommentStatement[])

Origem:
CodeCommentStatementCollection.cs
Origem:
CodeCommentStatementCollection.cs
Origem:
CodeCommentStatementCollection.cs

Copia os elementos da matriz CodeCommentStatement especificada para o fim da coleção.

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

Parâmetros

value
CodeCommentStatement[]

Uma matriz do tipo CodeCommentStatement que contém os objetos a serem adicionados à coleção.

Exceções

value é null.

Exemplos

O exemplo a seguir demonstra como usar a sobrecarga do AddRange(CodeCommentStatement[]) método para adicionar os membros de uma CodeCommentStatement matriz ao 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)

Confira também

Aplica-se a

AddRange(CodeCommentStatementCollection)

Origem:
CodeCommentStatementCollection.cs
Origem:
CodeCommentStatementCollection.cs
Origem:
CodeCommentStatementCollection.cs

Copia o conteúdo de outro objeto CodeCommentStatementCollection para o final da coleção.

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)

Parâmetros

value
CodeCommentStatementCollection

Um CodeCommentStatementCollection que contém os objetos a serem adicionados à coleção.

Exceções

value é null.

Exemplos

O exemplo a seguir demonstra como usar a sobrecarga do AddRange(CodeCommentStatementCollection) método para adicionar os membros um CodeCommentStatementCollection ao outro.

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

Confira também

Aplica-se a