CodeCommentStatementCollection.AddRange Metodo

Definizione

Copia gli elementi della matrice di oggetti CodeCommentStatement specificata alla fine dell'insieme.

Overload

AddRange(CodeCommentStatement[])

Copia gli elementi della matrice di oggetti CodeCommentStatement specificata alla fine dell'insieme.

AddRange(CodeCommentStatementCollection)

Copia il contenuto di un altro oggetto CodeCommentStatementCollection alla fine dell'insieme.

AddRange(CodeCommentStatement[])

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

Copia gli elementi della matrice di oggetti CodeCommentStatement specificata alla fine dell'insieme.

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

Parametri

value
CodeCommentStatement[]

Matrice di tipo CodeCommentStatement contenente gli oggetti da aggiungere all'insieme.

Eccezioni

value è null.

Esempio

Nell'esempio seguente viene illustrato come usare l'overload del AddRange(CodeCommentStatement[]) metodo per aggiungere i membri di una CodeCommentStatement matrice a 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)

Vedi anche

Si applica a

AddRange(CodeCommentStatementCollection)

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

Copia il contenuto di un altro oggetto CodeCommentStatementCollection alla fine dell'insieme.

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)

Parametri

value
CodeCommentStatementCollection

Oggetto CodeCommentStatementCollection che contiene gli oggetti da aggiungere all'insieme.

Eccezioni

value è null.

Esempio

Nell'esempio seguente viene illustrato come usare l'overload del AddRange(CodeCommentStatementCollection) metodo per aggiungere i membri di uno CodeCommentStatementCollection a un altro.

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

Vedi anche

Si applica a