Пример #1
0
        public CMemento GetByTitle(string title)
        {
            if (!PreviousStates.ContainsKey(title))
            {
                Console.WriteLine("Not in dictionary!");
                return(null);
            }

            else
            {
                CMemento memento = PreviousStates[title];
                return(memento);
            }
        }
Пример #2
0
 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;
     }
 }
Пример #3
0
 public void AddState(CMemento memento)
 {
     PreviousStates.Add(memento.Title, memento);
 }