Udostępnij za pośrednictwem


CodeCommentStatementCollection.AddRange Metoda

Definicja

Kopiuje elementy określonej CodeCommentStatement tablicy na końcu kolekcji.

Przeciążenia

AddRange(CodeCommentStatement[])

Kopiuje elementy określonej CodeCommentStatement tablicy na końcu kolekcji.

AddRange(CodeCommentStatementCollection)

Kopiuje zawartość innego CodeCommentStatementCollection obiektu na końcu kolekcji.

AddRange(CodeCommentStatement[])

Źródło:
CodeCommentStatementCollection.cs
Źródło:
CodeCommentStatementCollection.cs
Źródło:
CodeCommentStatementCollection.cs

Kopiuje elementy określonej CodeCommentStatement tablicy na końcu kolekcji.

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

Parametry

value
CodeCommentStatement[]

Tablica typu CodeCommentStatement zawierająca obiekty do dodania do kolekcji.

Wyjątki

value to null.

Przykłady

W poniższym przykładzie pokazano, jak za pomocą AddRange(CodeCommentStatement[]) przeciążenia metody dodać elementy członkowskie CodeCommentStatement tablicy do klasy 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)

Zobacz też

Dotyczy

AddRange(CodeCommentStatementCollection)

Źródło:
CodeCommentStatementCollection.cs
Źródło:
CodeCommentStatementCollection.cs
Źródło:
CodeCommentStatementCollection.cs

Kopiuje zawartość innego CodeCommentStatementCollection obiektu na końcu kolekcji.

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)

Parametry

value
CodeCommentStatementCollection

Obiekt CodeCommentStatementCollection zawierający obiekty do dodania do kolekcji.

Wyjątki

value to null.

Przykłady

W poniższym przykładzie pokazano, jak za pomocą AddRange(CodeCommentStatementCollection) przeciążenia metody dodać elementy członkowskie do CodeCommentStatementCollection innego.

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

Zobacz też

Dotyczy