CodeStatementCollection.AddRange 메서드

정의

컬렉션에 개체 집합 CodeStatement 을 추가합니다.

오버로드

Name Description
AddRange(CodeStatement[])

컬렉션에 개체 집합 CodeStatement 을 추가합니다.

AddRange(CodeStatementCollection)

컬렉션의 끝에 다른 CodeStatementCollection 개체의 내용을 추가합니다.

AddRange(CodeStatement[])

컬렉션에 개체 집합 CodeStatement 을 추가합니다.

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

매개 변수

value
CodeStatement[]

컬렉션에 추가할 개체의 CodeStatement 배열입니다.

예외

valuenull입니다.

예제

다음 예제에서는 메서드 오버로드를 AddRange(CodeStatement[]) 사용하여 배열의 멤버를 인스턴스에 CodeStatementCollection 추가하는 방법을 보여 줍니다.

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

추가 정보

적용 대상

AddRange(CodeStatementCollection)

컬렉션의 끝에 다른 CodeStatementCollection 개체의 내용을 추가합니다.

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)

매개 변수

value
CodeStatementCollection

CodeStatementCollection 컬렉션에 추가할 개체가 들어 있는 개체입니다.

예외

valuenull입니다.

예제

다음 예제에서는 메서드 오버로드를 AddRange(CodeStatementCollection) 사용하여 하나의 CodeStatementCollection 멤버를 다른 멤버에 추가하는 방법을 보여 줍니다.

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

추가 정보

적용 대상