BindingMemberInfo BindingMemberInfo BindingMemberInfo BindingMemberInfo Struct

定义

包含信息,使 Binding 可以将数据绑定解析为某对象的属性或对象列表中当前对象的属性。Contains information that enables a Binding to resolve a data binding to either the property of an object or the property of the current object in a list of objects.

public value class BindingMemberInfo
public struct BindingMemberInfo
type BindingMemberInfo = struct
Public Structure BindingMemberInfo
继承
BindingMemberInfoBindingMemberInfoBindingMemberInfoBindingMemberInfo

示例

下面的代码示例输出BindingPathBindingFieldBindingMember为每个控件在窗体上。The following code example prints the BindingPath, BindingField, BindingMember for each control on a form.

private:
   void PrintBindingMemberInfo()
   {
      for each ( Control^ c in this->Controls )
      {
         for each ( Binding^ b in c->DataBindings )
         {
            Console::WriteLine( "\n {0}", c );
            BindingMemberInfo bInfo = b->BindingMemberInfo;
            Console::WriteLine( "Binding Path \t {0}", bInfo.BindingPath );
            Console::WriteLine( "Binding Field \t {0}", bInfo.BindingField );
            Console::WriteLine( "Binding Member \t {0}", bInfo.BindingMember );
         }
      }
   }
private void PrintBindingMemberInfo()
{
   foreach(Control c in this.Controls)
   {
      foreach(Binding b in c.DataBindings)
      {
         Console.WriteLine("\n" + c.ToString());
         BindingMemberInfo bInfo = b.BindingMemberInfo;
         Console.WriteLine("Binding Path \t" + bInfo.BindingPath);
         Console.WriteLine("Binding Field \t" + bInfo.BindingField);
         Console.WriteLine("Binding Member \t" + bInfo.BindingMember);
      }
   }
}
Private Sub PrintBindingMemberInfo()
  Dim c As Control
  Dim b As Binding
  For Each c In  Me.Controls         
     For Each b In  c.DataBindings
        Console.WriteLine(ControlChars.Cr + c.ToString())
        Dim bInfo As BindingMemberInfo = b.BindingMemberInfo
        Console.WriteLine("Binding Path " + ControlChars.Tab _
                          + bInfo.BindingPath)
        Console.WriteLine("Binding Field " + ControlChars.Tab _
                          + bInfo.BindingField)
        Console.WriteLine("Binding Member " + ControlChars.Tab _
                          + bInfo.BindingMember)
      Next b
   Next c
End Sub

注解

BindingMemberInfo返回的BindingMemberInfo属性的Binding类。The BindingMemberInfo is returned by the BindingMemberInfo property of the Binding class.

BindingMemberInfo根据字符串传递给创建BindingMemberInfo构造函数。The BindingMemberInfo is created from the string passed to the BindingMemberInfo constructor.

构造函数

BindingMemberInfo(String) BindingMemberInfo(String) BindingMemberInfo(String) BindingMemberInfo(String)

初始化 BindingMemberInfo 类的新实例。Initializes a new instance of the BindingMemberInfo class.

属性

BindingField BindingField BindingField BindingField

获取数据绑定对象的属性名。Gets the property name of the data-bound object.

BindingMember BindingMember BindingMember BindingMember

获取用于指定数据绑定对象的属性名的信息。Gets the information that is used to specify the property name of the data-bound object.

BindingPath BindingPath BindingPath BindingPath

获取数据绑定对象的属性名之前的属性名或句点分隔的属性名层次结构。Gets the property name, or the period-delimited hierarchy of property names, that comes before the property name of the data-bound object.

方法

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定指定对象是否等于该 BindingMemberInfoDetermines whether the specified object is equal to this BindingMemberInfo.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

返回该 BindingMemberInfo 的哈希代码。Returns the hash code for this BindingMemberInfo.

操作员

Equality(BindingMemberInfo, BindingMemberInfo) Equality(BindingMemberInfo, BindingMemberInfo) Equality(BindingMemberInfo, BindingMemberInfo) Equality(BindingMemberInfo, BindingMemberInfo)

确定两个 BindingMemberInfo 对象是否相等。Determines whether two BindingMemberInfo objects are equal.

Inequality(BindingMemberInfo, BindingMemberInfo) Inequality(BindingMemberInfo, BindingMemberInfo) Inequality(BindingMemberInfo, BindingMemberInfo) Inequality(BindingMemberInfo, BindingMemberInfo)

确定两个 BindingMemberInfo 对象是否相等。Determines whether two BindingMemberInfo objects are not equal.

适用于

另请参阅