/** * Overridden to preserve usual semantics: returns true if a redo * operation would be successful now, false otherwise */ public override bool CanRedo() { if (inProgress) { IUndoableEdit edit = EditToBeRedone(); return(edit != null && edit.CanRedo()); } else { return(base.CanRedo()); } }
public override bool CanRedo() { lock (this) { if (IsInProgress()) { IUndoableEdit e = EditToBeUndone(); return(e != null && e.CanRedo()); } else { return(base.CanRedo()); } } }
/// <summary> /// This predicate is true when one can call <see cref="Redo"/>. /// </summary> /// <returns></returns> /// <remarks> /// In order to be able to perform a redo, a transaction must not /// be in progress, nor an undo or a redo. /// Furthermore there must be an <see cref="EditToRedo"/> that itself /// is ready to be redone, because its <see cref="IUndoableEdit.CanRedo"/> /// predicate is true. /// </remarks> /// <seealso cref="Redo"/> public virtual bool CanRedo() { if (this.TransactionLevel > 0) { return(false); } if (this.IsUndoingRedoing) { return(false); } IUndoableEdit curr = this.EditToRedo; return(curr != null && curr.CanRedo()); }
public virtual bool CanRedo() { if (this.TransactionLevel <= 0) { if (this.IsUndoing) { return(false); } if (this.IsRedoing) { return(false); } IUndoableEdit edit1 = this.EditToRedo; if (edit1 != null) { return(edit1.CanRedo()); } } return(false); }