public void BeginEdit() { if (this.restorePointToken == null) { this.restorePointToken = this.privateTracker.AddRestorePoint(); } }
public void CancelEdit() { if (this.restorePointToken != null) { this.privateTracker.UndoTo(this.restorePointToken); this.restorePointToken = null; } }
public virtual void RedoTo(RestorePointToken token) { if (!this.UndoRedoOperationEnabledCheck()) { return; } this.UndoToRestorePoint( () => this.RedoOperationCollection.GetOperationsToRestorePoint(token), this.UndoOperationCollection.Push, string.Format(this.NameGenerationConfiguration.RedoToStringFormat, token.Name)); }
public void Trim(RestorePointToken restorePoint) { int?index = this.RestorePointIndex(o => (o is RestorePoint) && ReferenceEquals(((RestorePoint)o).Token, restorePoint)); if (!index.HasValue) { return; } for (int i = 0; i < index.Value; i++) { var removed = this.operations.First; this.operations.RemoveFirst(); this.OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, removed)); } }
public bool RestorePointExists(RestorePointToken restorePoint) { return(this.UndoOperationCollection.RestorePointExists(restorePoint)); }
public virtual void UndoTo(RestorePointToken token) { if (!this.UndoRedoOperationEnabledCheck()) { return; } this.UndoToRestorePoint( () => this.UndoOperationCollection.GetOperationsToRestorePoint(token), this.RedoOperationCollection.Push, string.Format(this.NameGenerationConfiguration.UndoToStringFormat, token.Name)); }
public bool RestorePointExists(RestorePointToken restorePoint) { return this.UndoOperationCollection.RestorePointExists(restorePoint); }
public bool RestorePointExists(RestorePointToken token) { return(this.RestorePointIndex(o => (o is RestorePoint) && ReferenceEquals(((RestorePoint)o).Token, token)) != null); }
public Stack <Operation> GetOperationsToRestorePoint(RestorePointToken token) { return(GetOperationsToRestorePoint(o => (o is RestorePoint) && ReferenceEquals(((RestorePoint)o).Token, token))); }
public RestorePoint(string name) { this.Name = name; this.Token = new RestorePointToken(name); }
public static void UndoTo( object trackedObject, RestorePointToken token ) { ITrackedObject to = CheckObject( trackedObject ); ((AggregateTracker)to.Tracker).UndoTo( token ); }
public static bool RestorePointExists(object trackedObject, RestorePointToken restorePoint) { ITrackedObject to = CheckObject(trackedObject); return ((AggregateTracker)to.Tracker).RestorePointExists(restorePoint); }
public void EndEdit() { this.restorePointToken = null; }
public void Trim(RestorePointToken restorePoint) { int? index = this.RestorePointIndex(o => (o is RestorePoint) && ReferenceEquals(((RestorePoint)o).Token, restorePoint)); if (!index.HasValue) { return; } for (int i = 0; i < index.Value; i++) { var removed = this.operations.First; this.operations.RemoveFirst(); this.OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, removed)); } }
public bool RestorePointExists(RestorePointToken token) { return this.RestorePointIndex(o => (o is RestorePoint) && ReferenceEquals(((RestorePoint)o).Token, token)) != null; }
public Stack<Operation> GetOperationsToRestorePoint(RestorePointToken token) { return GetOperationsToRestorePoint(o => (o is RestorePoint) && ReferenceEquals(((RestorePoint)o).Token, token)); }