ConfigurationSection.GetRuntimeObject メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > ConfigurationSection.GetRuntimeObject メソッドの意味・解説 

ConfigurationSection.GetRuntimeObject メソッド

メモ : このメソッドは、.NET Framework version 2.0 で新しく追加されたものです。

派生クラスでオーバーライドされると、カスタム オブジェクトを返します。

名前空間: System.Configuration
アセンブリ: System.Configuration (system.configuration.dll 内)
構文構文

解説解説

GetSection メソッドが実行時に呼び出されると、構成システムは最初に ConfigurationSection クラスの適切なインスタンスを作成し、次に GetRuntimeObject メソッドから取得したオブジェクトを返します。

既定では、GetRuntimeObject は、呼び出し元の ConfigurationSection を表すオブジェクトを返すだけです。

実装時の注意 GetRuntimeObject メソッドをオーバーライドして、実行時にカスタム型を返すことができます。 たとえば、ConfigurationSection クラスの設定の実行時の変更を制限するには、GetRuntimeObject をオーバーライドして、変更できる設定がある場合にはその設定に制限を適用するカスタム型を返します。 ランタイム オブジェクトが内部のみである場合、返されるオブジェクトは、オブジェクトを定義するアセンブリ外では使用できません。ConfigurationSection から派生した、実行時にアセンブリ内のコードによってのみアクセスできるオブジェクトを作成する方法の 1 つは、ConfigurationSection 実装を返すメソッドを含む内部ランタイム オブジェクトを作成することです。

使用例使用例

ConfigurationSection を使用する方法の例を次に示します。

' Customizes the use of CustomSection
 ' by setting _ReadOnly to false.
' Remember you must use it along with ThrowIfReadOnly.
Protected Overrides Function
 GetRuntimeObject() As Object
   ' To enable property setting just assign true to
   ' the following flag.
   _ReadOnly = True
   Return MyBase.GetRuntimeObject()
End Function 'GetRuntimeObject

// Customizes the use of CustomSection
// by setting _ReadOnly to false.
// Remember you must use it along with ThrowIfReadOnly.
protected override object GetRuntimeObject()
{
    // To enable property setting just assign true to
    // the following flag.
    _ReadOnly = true;
    return base.GetRuntimeObject();
}

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からConfigurationSection.GetRuntimeObject メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からConfigurationSection.GetRuntimeObject メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からConfigurationSection.GetRuntimeObject メソッド を検索

英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

ConfigurationSection.GetRuntimeObject メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



ConfigurationSection.GetRuntimeObject メソッドのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS