ConfigurationElementCollection.CreateNewElement メソッド

定義

派生クラスでオーバーライドされると、新しい ConfigurationElement を作成します。

オーバーロード

CreateNewElement(String)

派生クラスでオーバーライドされると、新しい ConfigurationElement を作成します。

CreateNewElement()

派生クラスでオーバーライドされると、新しい ConfigurationElement を作成します。

注釈

メソッドを CreateNewElement オーバーライドして、特定の型のカスタム ConfigurationElement オブジェクトを作成します。 構成ファイルからコレクションが読み込まれると、 が呼び出され、 CreateNewElement 個々の要素が作成されます。 CreateNewElement は、 クラスから派生したクラスでオーバーライドする ConfigurationElementCollection 必要があります。

CreateNewElement(String)

ソース:
ConfigurationElementCollection.cs
ソース:
ConfigurationElementCollection.cs
ソース:
ConfigurationElementCollection.cs

派生クラスでオーバーライドされると、新しい ConfigurationElement を作成します。

protected:
 virtual System::Configuration::ConfigurationElement ^ CreateNewElement(System::String ^ elementName);
protected virtual System.Configuration.ConfigurationElement CreateNewElement (string elementName);
abstract member CreateNewElement : string -> System.Configuration.ConfigurationElement
override this.CreateNewElement : string -> System.Configuration.ConfigurationElement
Protected Overridable Function CreateNewElement (elementName As String) As ConfigurationElement

パラメーター

elementName
String

作成する ConfigurationElement の名前。

戻り値

指定した名前の新しい ConfigurationElement

注釈

メソッドを CreateNewElement オーバーライドして、特定の型のカスタム ConfigurationElement オブジェクトを作成します。 構成ファイルからコレクションが読み込まれると、 が呼び出され、 CreateNewElement 個々の要素が作成されます。 CreateNewElement は、 クラスから派生したクラスでオーバーライドする ConfigurationElementCollection 必要があります。

注意 (継承者)

異種ConfigurationElement型を含むカスタム ConfigurationElementCollection コレクションを作成する場合は、次の手順を実行する必要があります。

適用対象

CreateNewElement()

ソース:
ConfigurationElementCollection.cs
ソース:
ConfigurationElementCollection.cs
ソース:
ConfigurationElementCollection.cs

派生クラスでオーバーライドされると、新しい ConfigurationElement を作成します。

protected:
 abstract System::Configuration::ConfigurationElement ^ CreateNewElement();
protected abstract System.Configuration.ConfigurationElement CreateNewElement ();
abstract member CreateNewElement : unit -> System.Configuration.ConfigurationElement
Protected MustOverride Function CreateNewElement () As ConfigurationElement

戻り値

新しく作成した ConfigurationElement

次のコード例は、 メソッドをオーバーライドする方法を CreateNewElement 示しています。

protected override ConfigurationElement CreateNewElement()
{
    return new UrlConfigElement();
}
Protected Overloads Overrides Function CreateNewElement() As ConfigurationElement
    Return New UrlConfigElement()
End Function

注釈

メソッドを CreateNewElement オーバーライドして、特定の型のカスタム ConfigurationElement オブジェクトを作成します。 構成ファイルからコレクションが読み込まれると、 が呼び出され、 CreateNewElement 個々の要素が作成されます。 CreateNewElement は、 クラスから派生したクラスでオーバーライドする ConfigurationElementCollection 必要があります。

適用対象