MementoPattern.Originator.Set C# (CSharp) Method

Set() public method

public Set ( string article ) : void
article string
return void
        public void Set(string article)
        {
            Debug.Log ("From Originator: Current Version of article is: [\"" + article + "\"]");
            this.article = article;
        }

Usage Example

 public Program()
 {
     myStore    = new CareTaker();
     originator = new Originator();
     Console.WriteLine("Storing Memento");
     originator.Set("My Initial State which will be stored");
     myStore.ADD(originator.Store());
     itemNumber++;
     originator.Set("My Changed State which will not be stored and will be restored");
     Console.WriteLine("Restored : " + originator.Restore(myStore.GetMemento(itemNumber - 1)));
     Console.ReadLine();
 }
All Usage Examples Of MementoPattern.Originator::Set