ConfigurationCollectionAttribute.AddItemName 속성

정의

<add> 구성 요소의 이름을 가져오거나 설정합니다.

public:
 property System::String ^ AddItemName { System::String ^ get(); void set(System::String ^ value); };
public string AddItemName { get; set; }
member this.AddItemName : string with get, set
Public Property AddItemName As String

속성 값

구성 항목의 표준 이름 "add"를 대체하는 이름입니다.

예제

다음 예제에서는 AddItemName 속성을 사용하는 방법을 보여 줍니다.

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

설명

AddItemName 속성을 사용하면 구성 요소에 다른 이름을 할당할 수 있습니다. 예를 들어 "add" 대신 를 사용할 addUrl 수 있습니다.

적용 대상