BindingManagerDataErrorEventArgs 類別

定義

提供 DataError 事件的資料。

public ref class BindingManagerDataErrorEventArgs : EventArgs
public class BindingManagerDataErrorEventArgs : EventArgs
type BindingManagerDataErrorEventArgs = class
    inherit EventArgs
Public Class BindingManagerDataErrorEventArgs
Inherits EventArgs
繼承
BindingManagerDataErrorEventArgs

範例

下列程式代碼範例示範此類型的用法。 在這個例子中,事件處理者會回報事件 DataError 的發生情況。 此報告能幫助您了解事件發生時間,並協助除錯。 若要報告多個事件或頻繁發生的事件,請考慮將Show訊息替換Console.WriteLine為或附加於多行TextBox

要執行範例程式碼,將它貼到包含繼承自 BindingManagerBase的型別實例的專案中,例如 a PropertyManagerCurrencyManager。 接著命名實例 BindingManagerBase1 ,並確保事件處理程序與事件 DataError 相關聯。

private void BindingManagerBase1_DataError(Object sender, BindingManagerDataErrorEventArgs e) {
    System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
    messageBoxCS.AppendFormat("{0} = {1}", "Exception", e.Exception);
    messageBoxCS.AppendLine();
    MessageBox.Show(messageBoxCS.ToString(), "DataError Event");
}
Private Sub BindingManagerBase1_DataError(sender as Object, e as BindingManagerDataErrorEventArgs) _ 
     Handles BindingManagerBase1.DataError

    Dim messageBoxVB as New System.Text.StringBuilder()
    messageBoxVB.AppendFormat("{0} = {1}", "Exception", e.Exception)
    messageBoxVB.AppendLine()
    MessageBox.Show(messageBoxVB.ToString(),"DataError Event")

End Sub

備註

BindingManagerDataErrorEventArgs提供Exception了被綁定過程中被抓到的部分。

建構函式

名稱 Description
BindingManagerDataErrorEventArgs(Exception)

初始化 BindingManagerDataErrorEventArgs 類別的新執行個體。

屬性

名稱 Description
Exception

Exception被觸發事件的綁定過程DataError卡住了。

方法

名稱 Description
Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetHashCode()

做為預設哈希函式。

(繼承來源 Object)
GetType()

取得目前實例的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object的淺層複本。

(繼承來源 Object)
ToString()

傳回表示目前 物件的字串。

(繼承來源 Object)

適用於