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 편집 상태를 종료 하 고 편집 된 개체의 변경 내용이 되돌릴 논리를 제공 하 여 뷰가 있습니다.

적용 대상