public string GetNextUndoActionString() { if (undoCommands.Count == 0) { return(String.Empty); } for (int i = undoCommands.Count - 1; i >= 0; i--) { IReversibleCommand cmd = (IReversibleCommand)undoCommands[i]; if (cmd.BeginCommandRange) { return(cmd.GetDisplayActionString()); } } // If the command starting the CommandRange is not found, return the first... return(((IReversibleCommand)undoCommands[undoCommands.Count - 1]).GetDisplayActionString()); }