DataBinding.Expression プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > DataBinding.Expression プロパティの意味・解説 

DataBinding.Expression プロパティ

評価されるデータ連結式を取得します

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

使用例使用例

DataBinding オブジェクト作成しpropertyName パラメータの値が Text である、コントロールの DataBindingCollection コレクション既存オブジェクト同じようにこのオブジェクト設定する例を次に示しますpropertyName の値が TextDataBinding オブジェクトコレクション含まれている場合、このコードは、オブジェクトExpression プロパティの値を返しますそのようなオブジェクトない場合は、空の文字列 ("") が返されます。

' Create a Text property with accessors that obtain 
' the property value from and set the property value
' to the Text key in the DataBindingCollection class.

Public Property [Text]() As
 String
    Get
        Dim myBinding As DataBinding = DataBindings("Text")
        If Not (myBinding Is
 Nothing) Then
            Return myBinding.Expression
        End If
        Return String.Empty
    End Get
    Set(ByVal value As String)

        If value Is Nothing
 OrElse value.Length = 0 Then
            DataBindings.Remove("Text")
        Else

            Dim binding As DataBinding = DataBindings("Text")

            If binding Is Nothing
 Then
                binding = New DataBinding("Text",
 GetType(String), value)
            Else
                binding.Expression = value
            End If
            ' Call the DataBinding constructor, then add
            ' the initialized DataBinding object to the 
            ' DataBindingCollection for this custom designer.
            Dim binding1 As DataBinding = CType(DataBindings.SyncRoot,
 DataBinding)
            DataBindings.Add(binding)
            DataBindings.Add(binding1)
        End If
        PropertyChanged("Text")
    End Set
End Property

// Create a Text property with accessors that obtain 
// the property value from and set the property value
// to the Text key in the DataBindingCollection class.
public string Text
{
    get
    {
        DataBinding myBinding = DataBindings["Text"];
        if (myBinding != null)
        {
            return myBinding.Expression;
        }
        return String.Empty;
    }
    set
    {

        if ((value == null) || (value.Length
 == 0))
        {
            DataBindings.Remove("Text");
        }
        else
        {

            DataBinding binding = DataBindings["Text"];

            if (binding == null)
            {
                binding = new DataBinding("Text", typeof(string),
 value);
            }
            else
            {
                binding.Expression = value;
            }
            // Call the DataBinding constructor, then add
            // the initialized DataBinding object to the 
            // DataBindingCollection for this custom designer.
            DataBinding binding1 = (DataBinding)DataBindings.SyncRoot;
            DataBindings.Add(binding);
            DataBindings.Add(binding1);
        }
        PropertyChanged("Text");
    }
}
// Create a Text property with accessors that obtain 
// the property value from and set the property value
// to the Text key in the DataBindingCollection class.
/** @property 
 */
public String get_Text()
{
    DataBinding myBinding = get_DataBindings().get_Item("Text");
    if (myBinding != null) {
        return myBinding.get_Expression();
    }
    return("");
} //get_Text

/** @property 
 */
public void set_Text(String value)
{
    if (value == null || value.get_Length()
 == 0) {
        get_DataBindings().Remove("Text");
    }
    else {
        DataBinding binding = get_DataBindings().get_Item("Text");
        if (binding == null) {
            binding = new DataBinding("Text", String.class.ToType(),
 value);
        }
        else {
            binding.set_Expression(value);
        }

        // Call the DataBinding constructor, then add
        // the initialized DataBinding object to the 
        // DataBindingCollection for this custom designer.
        DataBinding binding1 = (DataBinding)(get_DataBindings().
            get_SyncRoot());
        get_DataBindings().Add(binding);
        get_DataBindings().Add(binding1);
    }
    OnBindingsCollectionChanged("Text");
} //set_Text
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

DataBinding.Expression プロパティのお隣キーワード
検索ランキング

   

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



DataBinding.Expression プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS