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

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

Parameter.OnParameterChanged メソッド

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

Parameter オブジェクトを格納する ParameterCollection コレクションの OnParametersChanged メソッドを呼び出します。

名前空間: System.Web.UI.WebControls
アセンブリ: System.Web (system.web.dll 内)
構文構文

Protected Sub OnParameterChanged
Me.OnParameterChanged
protected void OnParameterChanged ()
protected:
void OnParameterChanged ()
protected void OnParameterChanged ()
protected function OnParameterChanged ()
解説解説

Parameter オブジェクトが ParameterCollection コレクションに含まれていない場合、OnParameterChanged メソッドの呼び出しは無効になります。Parameter オブジェクトが ParameterCollection コレクションに含まれている場合には、OnParameterChanged はコレクションの ParameterCollection.ParametersChanged イベントを発生させます。

ParameterCollection コレクションがデータ ソース コントロールに格納されている場合、ParameterCollection.ParametersChanged イベントは、そのデータ ソース コントロールの System.Web.UI.IDataSource.DataSourceChanged イベントを発生させます。これにより、データ バインド コントロールが再バインドします。

イベントが発生すると、デリゲートを使用してイベント ハンドラが呼び出されます。詳細については、「イベントの発生」を参照してください。

OnParameterChanged メソッドを使用すると、デリゲートを結び付けずに、派生クラスでイベントを処理することもできます。派生クラスでイベントを処理する場合は、この手法をお勧めします。

継承時の注意 派生クラスで OnParameterChanged をオーバーライドする場合は、登録されているデリゲートがイベントを受け取ることができるように、基本クラスの OnParameterChanged メソッドを呼び出してください。

使用例使用例

パラメータの状態が変更されたときに、OnParameterChanged メソッドを呼び出して ParametersChanged イベントを発生させる方法を次のコード例に示します。このコード例は Parameter クラスの概要で取り上げているコード例の一部分です。

' The Value property is a type safe convenience property
' used when the StaticParameter represents string data.
' It gets the string value of the DataValue property, and
' sets the DataValue property directly.
Public Property Value() As
 String
   Get
      Dim o As Object =
 DataValue
      If o Is Nothing OrElse
 Not TypeOf o Is String
 Then
         Return String.Empty
      End If
      Return CStr(o)
   End Get
   Set
      DataValue = value
      OnParameterChanged()
   End Set
End Property
// The Value property is a type safe convenience property
// used when the StaticParameter represents string data.
// It gets the string value of the DataValue property, and
// sets the DataValue property directly.
public string Value {
  get {
    object o = DataValue;
    if (o == null || !(o is string))
      return String.Empty;
    return (string)o;
  }
  set {
    DataValue = value;
    OnParameterChanged();
  }
}
// The Value property is a type safe convenience property 
// used when the StaticParameter represents string data.
// It gets the string value of the DataValue property, and
// sets the DataValue property directly.
/** @property 
 */
public String get_Value()
{
    Object o = get_DataValue();

    if (o == null || !(o instanceof String))
 {
        return String.Empty;
    }

    return (String)(o);
} //get_Value


/** @property 
 */
public void set_Value(String value)
{
    set_DataValue(value);
    OnParameterChanged();
} //set_Value
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
Parameter クラス
Parameter メンバ
System.Web.UI.WebControls 名前空間
ParametersChanged



英和和英テキスト翻訳

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

辞書ショートカット

すべての辞書の索引

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

   

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



Parameter.OnParameterChanged メソッドのページの著作権

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

©2026 GRAS Group, Inc.RSS