Binding.BindingMemberInfo Propriedade
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Obtém um objeto que contém informações sobre esta associação com base no parâmetro dataMember
no construtor Binding.
public:
property System::Windows::Forms::BindingMemberInfo BindingMemberInfo { System::Windows::Forms::BindingMemberInfo get(); };
public System.Windows.Forms.BindingMemberInfo BindingMemberInfo { get; }
member this.BindingMemberInfo : System.Windows.Forms.BindingMemberInfo
Public ReadOnly Property BindingMemberInfo As BindingMemberInfo
Um BindingMemberInfo que contém informações sobre isso Binding.
O exemplo de código a seguir obtém o BindingMemberInfo de cada Binding um em um formulário e imprime os BindingPathvalores , BindingFielde BindingMember de propriedade para isso Binding.
private:
void PrintBindingMemberInfo()
{
for each ( Control^ thisControl in this->Controls)
{
for each ( Binding^ thisBinding in thisControl->DataBindings)
{
// Print the control's name and Binding information.
Console::WriteLine( "\n {0}", thisControl );
BindingMemberInfo bInfo = thisBinding->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 thisControl in this.Controls)
{
foreach(Binding thisBinding in thisControl.DataBindings)
{
// Print the control's name and Binding information.
Console.WriteLine("\n" + thisControl.ToString());
BindingMemberInfo bInfo = thisBinding.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 thisControl As Control
For Each thisControl In Me.Controls
Dim thisBinding As Binding
For Each thisBinding In thisControl.DataBindings
' Print the control's name and Binding information.
Console.WriteLine(ControlChars.Cr + thisControl.ToString())
Dim bInfo As BindingMemberInfo = thisBinding.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 thisBinding
Next thisControl
End Sub
A BindingMemberInfo cadeia de caracteres é criada a partir da dataMember
cadeia de caracteres passada para o Binding construtor.
Produto | Versões |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 |
Windows Desktop | 3.0, 3.1, 5, 6, 7 |