IEditableCollectionView.CanCancelEdit 속성

정의

컬렉션 뷰에서 보류 중인 변경 내용을 취소하고 편집된 개체의 원래 값을 복원할 수 있는지 여부를 나타내는 값을 가져옵니다.

public:
 property bool CanCancelEdit { bool get(); };
public bool CanCancelEdit { get; }
member this.CanCancelEdit : bool
Public ReadOnly Property CanCancelEdit As Boolean

속성 값

true컬렉션 뷰에서 보류 중인 변경 내용을 취소하고 편집된 개체의 원래 값을 복원할 수 있으면 이고, 그렇지 않으면 . false

예제

다음 예제에서는 CanCancelEdit 편집된 항목의 원래 값을 호출 CancelEdit하기 전에 복원할 수 있는지 여부를 확인합니다. 값을 복원할 수 없는 경우 추가 논리를 제공해야 합니다. 가능한 경우 예제에서 호출 CancelEdit할 때 값이 복원됩니다. 전체 샘플은 IEditableCollectionView 샘플을 사용하여 컬렉션 변경을 참조하세요.

// If the objects in the collection can discard pending 
// changes, calling IEditableCollectionView.CancelEdit
// will revert the changes. Otherwise, you must provide
// your own logic to revert the changes in the object.

if (!editableCollectionView.CanCancelEdit)
{
    // Provide logic to revert changes.
}

editableCollectionView.CancelEdit();
' If the objects in the collection can discard pending 
' changes, calling IEditableCollectionView.CancelEdit
' will revert the changes. Otherwise, you must provide
' your own logic to revert the changes in the object.

If Not editableCollectionView.CanCancelEdit Then
    ' Provide logic to revert changes.
End If

editableCollectionView.CancelEdit()

설명

CanCancelEdittrue 뷰가 현재 편집된 항목에서 "보류 중인 변경 내용"의 개념을 지원하는 경우입니다. 예를 들어 편집된 항목이 구현true되거나 변경 내용을 롤백하는 데 사용할 수 있는 항목 상태에 대한 정보가 보기에 있는 경우 컬렉션 뷰가 반환 IEditableObject 될 수 있습니다. CanCancelEditfalse 뷰가 개체의 변경 내용을 되돌릴 수 없는 경우입니다. 이 경우 뷰를 호출 CancelEdit 하여 편집 상태를 종료하고 편집된 개체의 변경 내용을 되돌리는 논리를 제공합니다.

적용 대상