CodeStatementCollection.AddRange Yöntem

Tanım

Koleksiyona bir nesne kümesi CodeStatement ekler.

Aşırı Yüklemeler

Name Description
AddRange(CodeStatement[])

Koleksiyona bir nesne kümesi CodeStatement ekler.

AddRange(CodeStatementCollection)

Başka bir CodeStatementCollection nesnenin içeriğini koleksiyonun sonuna ekler.

AddRange(CodeStatement[])

Kaynak:
CodeStatementCollection.cs
Kaynak:
CodeStatementCollection.cs
Kaynak:
CodeStatementCollection.cs
Kaynak:
CodeStatementCollection.cs
Kaynak:
CodeStatementCollection.cs
Kaynak:
CodeStatementCollection.cs
Kaynak:
CodeStatementCollection.cs

Koleksiyona bir nesne kümesi CodeStatement ekler.

public:
 void AddRange(cli::array <System::CodeDom::CodeStatement ^> ^ value);
public void AddRange(System.CodeDom.CodeStatement[] value);
member this.AddRange : System.CodeDom.CodeStatement[] -> unit
Public Sub AddRange (value As CodeStatement())

Parametreler

value
CodeStatement[]

Koleksiyona eklenecek nesne dizisi CodeStatement .

Özel durumlar

value, null'e eşittir.

Örnekler

Aşağıdaki örnekte, bir dizinin AddRange(CodeStatement[]) üyelerini bir örneğe eklemek için yöntem aşırı yüklemesinin nasıl kullanılacağı CodeStatementCollection gösterilmektedir.

// Adds an array of CodeStatement objects to the collection.
CodeStatement[] statements = {
                new CodeCommentStatement("Test comment statement"),
                new CodeCommentStatement("Test comment statement")};
collection.AddRange( statements );

// Adds a collection of CodeStatement objects to the collection.
CodeStatement testStatement = new CodeCommentStatement("Test comment statement");
CodeStatementCollection statementsCollection = new CodeStatementCollection();
statementsCollection.Add( new CodeCommentStatement("Test comment statement") );
statementsCollection.Add( new CodeCommentStatement("Test comment statement") );
statementsCollection.Add( testStatement );

collection.AddRange( statementsCollection );
' Adds an array of CodeStatement objects to the collection.
Dim statements As CodeStatement() = {New CodeCommentStatement("Test comment statement"), New CodeCommentStatement("Test comment statement")}
collection.AddRange(statements)

' Adds a collection of CodeStatement objects to the collection.
Dim testStatement As New CodeStatement
Dim statementsCollection As New CodeStatementCollection
statementsCollection.Add(New CodeCommentStatement("Test comment statement"))
statementsCollection.Add(New CodeCommentStatement("Test comment statement"))
statementsCollection.Add(testStatement)
collection.AddRange(statementsCollection)

Ayrıca bkz.

Şunlara uygulanır

AddRange(CodeStatementCollection)

Kaynak:
CodeStatementCollection.cs
Kaynak:
CodeStatementCollection.cs
Kaynak:
CodeStatementCollection.cs
Kaynak:
CodeStatementCollection.cs
Kaynak:
CodeStatementCollection.cs
Kaynak:
CodeStatementCollection.cs
Kaynak:
CodeStatementCollection.cs

Başka bir CodeStatementCollection nesnenin içeriğini koleksiyonun sonuna ekler.

public:
 void AddRange(System::CodeDom::CodeStatementCollection ^ value);
public void AddRange(System.CodeDom.CodeStatementCollection value);
member this.AddRange : System.CodeDom.CodeStatementCollection -> unit
Public Sub AddRange (value As CodeStatementCollection)

Parametreler

value
CodeStatementCollection

CodeStatementCollection Koleksiyona eklenecek nesneleri içeren nesne.

Özel durumlar

value, null'e eşittir.

Örnekler

Aşağıdaki örnek, yöntem aşırı yüklemesini AddRange(CodeStatementCollection) kullanarak birinin üyelerini diğerine CodeStatementCollection nasıl ekleyeceğini gösterir.

// Adds an array of CodeStatement objects to the collection.
CodeStatement[] statements = {
                new CodeCommentStatement("Test comment statement"),
                new CodeCommentStatement("Test comment statement")};
collection.AddRange( statements );

// Adds a collection of CodeStatement objects to the collection.
CodeStatement testStatement = new CodeCommentStatement("Test comment statement");
CodeStatementCollection statementsCollection = new CodeStatementCollection();
statementsCollection.Add( new CodeCommentStatement("Test comment statement") );
statementsCollection.Add( new CodeCommentStatement("Test comment statement") );
statementsCollection.Add( testStatement );

collection.AddRange( statementsCollection );
' Adds an array of CodeStatement objects to the collection.
Dim statements As CodeStatement() = {New CodeCommentStatement("Test comment statement"), New CodeCommentStatement("Test comment statement")}
collection.AddRange(statements)

' Adds a collection of CodeStatement objects to the collection.
Dim testStatement As New CodeStatement
Dim statementsCollection As New CodeStatementCollection
statementsCollection.Add(New CodeCommentStatement("Test comment statement"))
statementsCollection.Add(New CodeCommentStatement("Test comment statement"))
statementsCollection.Add(testStatement)
collection.AddRange(statementsCollection)

Ayrıca bkz.

Şunlara uygulanır