Bagikan melalui


CodeCommentStatementCollection.AddRange Metode

Definisi

Menyalin elemen array yang ditentukan CodeCommentStatement ke akhir koleksi.

Overload

AddRange(CodeCommentStatement[])

Menyalin elemen array yang ditentukan CodeCommentStatement ke akhir koleksi.

AddRange(CodeCommentStatementCollection)

Menyalin isi objek lain CodeCommentStatementCollection ke akhir koleksi.

AddRange(CodeCommentStatement[])

Sumber:
CodeCommentStatementCollection.cs
Sumber:
CodeCommentStatementCollection.cs
Sumber:
CodeCommentStatementCollection.cs

Menyalin elemen array yang ditentukan CodeCommentStatement ke akhir koleksi.

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

Parameter

value
CodeCommentStatement[]

Array jenis CodeCommentStatement yang berisi objek untuk ditambahkan ke koleksi.

Pengecualian

valueadalah null.

Contoh

Contoh berikut menunjukkan cara menggunakan AddRange(CodeCommentStatement[]) metode kelebihan beban untuk menambahkan anggota CodeCommentStatement array ke 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)

Lihat juga

Berlaku untuk

AddRange(CodeCommentStatementCollection)

Sumber:
CodeCommentStatementCollection.cs
Sumber:
CodeCommentStatementCollection.cs
Sumber:
CodeCommentStatementCollection.cs

Menyalin isi objek lain CodeCommentStatementCollection ke akhir koleksi.

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)

Parameter

value
CodeCommentStatementCollection

CodeCommentStatementCollection yang berisi objek untuk ditambahkan ke koleksi.

Pengecualian

valueadalah null.

Contoh

Contoh berikut menunjukkan cara menggunakan AddRange(CodeCommentStatementCollection) metode kelebihan beban untuk menambahkan anggota satu CodeCommentStatementCollection ke yang lain.

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

Lihat juga

Berlaku untuk