DataBinding.Expression プロパティ
アセンブリ: System.Web (system.web.dll 内)

Dim instance As DataBinding Dim value As String value = instance.Expression instance.Expression = value
/** @property */ public String get_Expression () /** @property */ public void set_Expression (String value)
評価されるデータ連結式。

DataBinding オブジェクトを作成し、propertyName パラメータの値が Text である、コントロールの DataBindingCollection コレクションの既存のオブジェクトと同じようにこのオブジェクトを設定する例を次に示します。propertyName の値が Text の DataBinding オブジェクトがコレクションに含まれている場合、このコードは、オブジェクトの 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

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からDataBinding.Expression プロパティを検索する場合は、下記のリンクをクリックしてください。

- DataBinding.Expression プロパティのページへのリンク