ConfigurationCollectionAttribute.RemoveItemName 屬性

定義

取得或設定 <remove> 組態項目的名稱。

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

屬性值

取代組態項目之標準名稱 "remove" 的名稱。

範例

下列範例將示範如何使用 RemoveItemName 屬性。

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

備註

屬性 RemoveItemName 可讓您將不同的名稱指派給組 <remove> 態專案。 例如,您可以使用 removeUrl ,而不是 “remove”。

適用於