public My_Picture Undo() { int index = history.IndexOf(current); if (index > 0) { current = history.ElementAt <My_Picture>(index - 1); } return(current.Clone()); }
public void add(My_Picture item) { int index = history.IndexOf(current); current = item.Clone(); if (index == history.Count - 1) { history.Add(current); return; } history.RemoveRange(index + 1, (history.Count - index - 1)); history.Add(current); }
public My_Picture ReDo() { int index = history.IndexOf(current); if (index == history.Count - 1) { current = history.Last <My_Picture>(); } if (index == -1) { current = history.First <My_Picture>(); } current = history.ElementAt <My_Picture>(index + 1); return(current.Clone()); }