다음을 통해 공유


CodeAttributeDeclarationCollection.AddRange 메서드

정의

지정된 CodeAttributeDeclaration 배열의 요소를 컬렉션의 끝에 복사합니다.

오버로드

AddRange(CodeAttributeDeclaration[])

지정된 CodeAttributeDeclaration 배열의 요소를 컬렉션의 끝에 복사합니다.

AddRange(CodeAttributeDeclarationCollection)

다른 CodeAttributeDeclarationCollection 개체의 내용을 컬렉션 끝에 복사합니다.

AddRange(CodeAttributeDeclaration[])

Source:
CodeAttributeDeclarationCollection.cs
Source:
CodeAttributeDeclarationCollection.cs
Source:
CodeAttributeDeclarationCollection.cs

지정된 CodeAttributeDeclaration 배열의 요소를 컬렉션의 끝에 복사합니다.

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

매개 변수

value
CodeAttributeDeclaration[]

컬렉션에 추가할 개체가 들어 있는 CodeAttributeDeclaration 형식의 배열입니다.

예외

value이(가) null인 경우

예제

다음 예제에서는 메서드 오버로드를 사용하여 AddRange(CodeAttributeDeclaration[]) 개체 CodeAttributeDeclarationCollection배열 CodeAttributeDeclaration 을 에 추가하는 방법을 보여 줍니다.

// Adds an array of CodeAttributeDeclaration objects 
// to the collection.
array<CodeAttributeDeclaration^>^declarations = {gcnew CodeAttributeDeclaration,gcnew CodeAttributeDeclaration};
collection->AddRange( declarations );

// Adds a collection of CodeAttributeDeclaration objects 
// to the collection.
CodeAttributeDeclarationCollection^ declarationsCollection = gcnew CodeAttributeDeclarationCollection;
array<CodeAttributeArgument^>^temp1 = {gcnew CodeAttributeArgument( gcnew CodePrimitiveExpression( "Test Description" ) )};
declarationsCollection->Add( gcnew CodeAttributeDeclaration( "DescriptionAttribute",temp1 ) );
array<CodeAttributeArgument^>^temp2 = {gcnew CodeAttributeArgument( gcnew CodePrimitiveExpression( true ) )};
declarationsCollection->Add( gcnew CodeAttributeDeclaration( "BrowsableAttribute",temp2 ) );
collection->AddRange( declarationsCollection );
// Adds an array of CodeAttributeDeclaration objects
// to the collection.
CodeAttributeDeclaration[] declarations = { new CodeAttributeDeclaration(), new CodeAttributeDeclaration() };
collection.AddRange( declarations );

// Adds a collection of CodeAttributeDeclaration objects
// to the collection.
CodeAttributeDeclarationCollection declarationsCollection = new CodeAttributeDeclarationCollection();
declarationsCollection.Add( new CodeAttributeDeclaration("DescriptionAttribute", new CodeAttributeArgument(new CodePrimitiveExpression("Test Description"))) );
declarationsCollection.Add( new CodeAttributeDeclaration("BrowsableAttribute", new CodeAttributeArgument(new CodePrimitiveExpression(true))) );
collection.AddRange( declarationsCollection );
' Adds an array of CodeAttributeDeclaration objects to the collection.
Dim declarations As CodeAttributeDeclaration() = {New CodeAttributeDeclaration(), New CodeAttributeDeclaration()}
collection.AddRange(declarations)

' Adds a collection of CodeAttributeDeclaration objects to 
' the collection.
Dim declarationsCollection As New CodeAttributeDeclarationCollection()
declarationsCollection.Add(New CodeAttributeDeclaration("DescriptionAttribute", New CodeAttributeArgument(New CodePrimitiveExpression("Test Description"))))
declarationsCollection.Add(New CodeAttributeDeclaration("BrowsableAttribute", New CodeAttributeArgument(New CodePrimitiveExpression(True))))
collection.AddRange(declarationsCollection)

추가 정보

적용 대상

AddRange(CodeAttributeDeclarationCollection)

Source:
CodeAttributeDeclarationCollection.cs
Source:
CodeAttributeDeclarationCollection.cs
Source:
CodeAttributeDeclarationCollection.cs

다른 CodeAttributeDeclarationCollection 개체의 내용을 컬렉션 끝에 복사합니다.

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

매개 변수

value
CodeAttributeDeclarationCollection

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

예외

value이(가) null인 경우

예제

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

// Adds an array of CodeAttributeDeclaration objects 
// to the collection.
array<CodeAttributeDeclaration^>^declarations = {gcnew CodeAttributeDeclaration,gcnew CodeAttributeDeclaration};
collection->AddRange( declarations );

// Adds a collection of CodeAttributeDeclaration objects 
// to the collection.
CodeAttributeDeclarationCollection^ declarationsCollection = gcnew CodeAttributeDeclarationCollection;
array<CodeAttributeArgument^>^temp1 = {gcnew CodeAttributeArgument( gcnew CodePrimitiveExpression( "Test Description" ) )};
declarationsCollection->Add( gcnew CodeAttributeDeclaration( "DescriptionAttribute",temp1 ) );
array<CodeAttributeArgument^>^temp2 = {gcnew CodeAttributeArgument( gcnew CodePrimitiveExpression( true ) )};
declarationsCollection->Add( gcnew CodeAttributeDeclaration( "BrowsableAttribute",temp2 ) );
collection->AddRange( declarationsCollection );
// Adds an array of CodeAttributeDeclaration objects
// to the collection.
CodeAttributeDeclaration[] declarations = { new CodeAttributeDeclaration(), new CodeAttributeDeclaration() };
collection.AddRange( declarations );

// Adds a collection of CodeAttributeDeclaration objects
// to the collection.
CodeAttributeDeclarationCollection declarationsCollection = new CodeAttributeDeclarationCollection();
declarationsCollection.Add( new CodeAttributeDeclaration("DescriptionAttribute", new CodeAttributeArgument(new CodePrimitiveExpression("Test Description"))) );
declarationsCollection.Add( new CodeAttributeDeclaration("BrowsableAttribute", new CodeAttributeArgument(new CodePrimitiveExpression(true))) );
collection.AddRange( declarationsCollection );
' Adds an array of CodeAttributeDeclaration objects to the collection.
Dim declarations As CodeAttributeDeclaration() = {New CodeAttributeDeclaration(), New CodeAttributeDeclaration()}
collection.AddRange(declarations)

' Adds a collection of CodeAttributeDeclaration objects to 
' the collection.
Dim declarationsCollection As New CodeAttributeDeclarationCollection()
declarationsCollection.Add(New CodeAttributeDeclaration("DescriptionAttribute", New CodeAttributeArgument(New CodePrimitiveExpression("Test Description"))))
declarationsCollection.Add(New CodeAttributeDeclaration("BrowsableAttribute", New CodeAttributeArgument(New CodePrimitiveExpression(True))))
collection.AddRange(declarationsCollection)

추가 정보

적용 대상