ConfigurationCollectionAttribute.AddItemName Eigenschaft

Definition

Ruft den Namen des <add>-Konfigurationselements ab oder legt diesen fest.Gets or sets the name of the <add> configuration element.

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

Eigenschaftswert

String

Der Name, der den Standardnamen "add" für das Konfigurationselement ersetzt.The name that substitutes the standard name "add" for the configuration item.

Beispiele

Im folgenden Beispiel wird die Verwendung der AddItemName-Eigenschaft veranschaulicht.The following example shows how to use the AddItemName property.

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

Hinweise

Mit der- AddItemName Eigenschaft können Sie dem Konfigurationselement einen anderen Namen zuweisen.The AddItemName property allows you to assign a different name to the configuration element. Beispielsweise können Sie addUrl anstelle von "Add" verwenden.For example, you could use addUrl instead of "add".

Gilt für: