//Track the changes public void Push(int row, int col, string e, string bf, string af) { //For some weird reasons both " XmlSerializer" and "IXmlSerializable" don't work, hence I have to do it "manually" string key = null; string c = "<Cell row =\"" + row.ToString() + "\" col=\"" + col.ToString() + "\">"; if (e == "Color") { key = "Color"; cur = new URColor(ref view, row, col, int.Parse(bf), int.Parse(af)); c += "<BGColor>" + af + "</BGColor>"; } else if (e == "Value") { key = "Text"; cur = new URValue(ref view, row, col, bf, af); c += "<Text>" + af + "</Text>"; } c += "</Cell>"; if (key != null) { AddOrSet("Row:" + row.ToString() + "Col:" + col.ToString() + "Key:" + key, c); } undo.Push(cur); redo.Clear(); }
public void Redo() { if (!RedoIsEmpty()) { UndoRedoUnit tmp = redo.Pop(); tmp.perform(); undo.Push(tmp); } }