StoreInMemento() public method

public StoreInMemento ( ) : Memento
return Memento
 // these methods below might get called when someone is pressing a button
 // you could easily implement it with unitys new ui system :)
 public void Save(string text)
 {
     originator.Set(text);
     caretaker.Add(originator.StoreInMemento());
     savedFiles     = caretaker.GetCountOfSavedArticles();
     currentArticle = savedFiles;
 }
Ejemplo n.º 2
0
        private void BtnSave_Click(object sender, EventArgs e)
        {
            string textArea = lbText.Text;

            originator.Set(textArea);

            careTaker.AddMemento(originator.StoreInMemento());

            saveFiles++;
            currentArticle++;

            btnUndo.Enabled = true;
            Console.WriteLine(string.Format("Save Files {0}", saveFiles));
        }