ModelEditingScope 類別

定義

表示對編輯存放區的一組變更。Represents a group of changes to the editing store. 變更群組為可交易。Change groups are transactional. 在編輯範圍下所做的變更可以整批認可或中止。The changes made under an editing scope can be committed or aborted as a unit.

public ref class ModelEditingScope abstract : IDisposable
public abstract class ModelEditingScope : IDisposable
type ModelEditingScope = class
    interface IDisposable
Public MustInherit Class ModelEditingScope
Implements IDisposable
繼承
ModelEditingScope
衍生
實作

備註

認可編輯範圍時,編輯存放區會取得其中發生的所有變更並套用至模型。When an editing scope is committed, the editing store takes all changes that occurred within it and applies them to the model. 如果呼叫編輯範圍的Revert方法, 或在呼叫之前Complete處置編輯範圍, 編輯範圍會改為反轉對基礎物件所做的變更, 並從編輯存放區重新套用狀態。If the editing scope's Revert method is called, or the editing scope is disposed of before Complete is called, the editing scope will instead reverse the changes made to the underlying objects, reapplying state from the editing store. 這為復原機制提供穩固的基礎。This provides a solid basis for an undo mechanism.

建構函式

ModelEditingScope()

建立新的 ModelEditingScopeCreates a new ModelEditingScope.

屬性

Description

描述變更群組。Describes the group of changes. 它可在認可變更之前隨時加以變更。It can be changed anytime before the changes are committed.

方法

CanComplete()

判斷是否應呼叫 OnComplete(),或者應該還原變更。Determines whether OnComplete() should be called, or whether the change should instead be reverted. 還原的原因可能包括無法從原始檔控制系統簽出檔案以進行修改。Reasons for reverting might include a file cannot be checked out of a source control system for modification.

Complete()

藉由呼叫 OnComplete() 方法完成編輯範圍。Completes the editing scope by calling the OnComplete() method.

Dispose()

中止變更以處置這個物件,除非編輯範圍已經完成或還原。Disposes of this object by aborting changes unless the editing scope has already been completed or reverted.

Dispose(Boolean)

中止變更以處置這個物件。Disposes of this object by aborting changes.

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(繼承來源 Object)
OnComplete()

執行編輯範圍的實際完成。Performs the actual complete of the editing scope.

OnException(Exception)

處理例外狀況。Handles an exception.

OnRevert(Boolean)

執行編輯範圍的實際還原。Performs the actual revert of the editing scope.

Revert()

放棄在編輯範圍期間所做的變更。Abandons the changes made during the editing scope.

ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

適用於