ListViewUpdatedEventArgs.ExceptionHandled 속성

정의

업데이트 작업 중에 발생한 예외가 이벤트 발생 도중 처리되었는지 여부를 나타내는 값을 가져오거나 설정합니다.

public:
 property bool ExceptionHandled { bool get(); void set(bool value); };
public bool ExceptionHandled { get; set; }
member this.ExceptionHandled : bool with get, set
Public Property ExceptionHandled As Boolean

속성 값

Boolean

예외가 이벤트 처리기에서 처리되었으면 true이고, 그렇지 않으면 false입니다. 기본값은 false입니다.

예제

다음 예제에서는 사용 하는 방법을 보여 줍니다는 ExceptionHandled 처리을 나타내려면 예외를 이벤트 처리기는 속성입니다. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 ListViewUpdatedEventArgs 클래스입니다.

void ContactsListView_ItemUpdated(Object sender, ListViewUpdatedEventArgs e)
{
    if (e.Exception != null)
    {
        if (e.AffectedRows == 0)
        {
            e.KeepInEditMode = true;
            Message.Text = "An exception occurred updating the contact. " +
                                "Please verify your values and try again.";
        }
        else
            Message.Text = "An exception occurred updating the contact. " +
                                "Please verify the values in the recently updated item.";

        e.ExceptionHandled = true;
    }
}
Sub ContactsListView_ItemUpdated(sender As Object, e As ListViewUpdatedEventArgs)
    If e.Exception IsNot Nothing Then
        If e.AffectedRows = 0 Then
            e.KeepInEditMode = True
            Message.Text = "An exception occurred updating the contact. " & _
                                "Please verify your values and try again."
        Else
            Message.Text = "An exception occurred updating the contact. " & _
                                "Please verify the values in the recently updated item."
        End If

        e.ExceptionHandled = True
    End If
End Sub

설명

사용 하 여 업데이트 작업 중 예외가 발생 하면는 ExceptionHandled 이벤트 동안 예외가 처리 되었는지 여부를 나타내는 속성을 합니다. 이 속성 설정 된 경우 true, 예외 처리 된 것으로 간주 되어 하 여 다시 throw 되지 않습니다는 ListView 제어 합니다. 이 속성 설정 된 경우 false, ListView 컨트롤이 다시 예외를 throw 합니다. 발생 한 예외를 확인 하려면 사용 된 Exception 속성입니다.

적용 대상

추가 정보