public CMemento GetByTitle(string title) { if (!PreviousStates.ContainsKey(title)) { Console.WriteLine("Not in dictionary!"); return(null); } else { CMemento memento = PreviousStates[title]; return(memento); } }
public void RestoreState(CMemento previous) { if (previous == null) { Console.WriteLine(""); } else { this.title = previous.Title; this.text = previous.Text; this.timeDue = previous.TimeDue; this.CreationTime = previous.CreationTime; } }
public void AddState(CMemento memento) { PreviousStates.Add(memento.Title, memento); }