ConfigurationCollectionAttribute(Type) 생성자

정의

ConfigurationCollectionAttribute 클래스의 새 인스턴스를 초기화합니다.

public:
 ConfigurationCollectionAttribute(Type ^ itemType);
public ConfigurationCollectionAttribute (Type itemType);
new System.Configuration.ConfigurationCollectionAttribute : Type -> System.Configuration.ConfigurationCollectionAttribute
Public Sub New (itemType As Type)

매개 변수

itemType
Type

만들 속성 컬렉션의 형식입니다.

예외

itemType이(가) null인 경우

예제

다음 예제에서는 사용 하는 방법의 ConfigurationCollectionAttribute합니다.

// Declare the Urls collection property using the
// ConfigurationCollectionAttribute.
// This allows to build a nested section that contains
// a collection of elements.
[ConfigurationProperty("urls", IsDefaultCollection = false)]
[ConfigurationCollection(typeof(UrlsCollection),
    AddItemName = "add",
    ClearItemsName = "clear",
    RemoveItemName = "remove")]
public UrlsCollection Urls
{
    get
    {
        UrlsCollection urlsCollection =
            (UrlsCollection)base["urls"];
        return urlsCollection;
    }
}
' Declare the Urls collection property using the
' ConfigurationCollectionAttribute.
' This allows to build a nested section that contains
' a collection of elements.
<ConfigurationProperty("urls", IsDefaultCollection:=False),
    System.Configuration.ConfigurationCollection(GetType(UrlsCollection),
    AddItemName:="add", ClearItemsName:="clear", RemoveItemName:="remove")> _
Public ReadOnly Property Urls() As UrlsCollection
    Get
        Dim urlsCollection As UrlsCollection = CType(MyBase.Item("urls"), UrlsCollection)
        Return urlsCollection
    End Get
End Property

설명

이 생성자를 사용하여 만들 속성 컬렉션의 사용자 지정 형식을 .NET Framework 알릴 수 있습니다.

적용 대상