Represents a single memento (snapshot) of the text state before an operation is applied....
string _text
The snapshot of the text data as stored in the Memento_TextObject class instance.
string _name
The name of this memento (really just the name of the operation that triggered the need for this meme...
string Text
The saved text in this memento. This is accessible only by the Memento_TextObject class since it is t...
Memento(string name, string text)
Constructor.
Container for a string. Need to use a class that allows the text to be changed while the container (t...
string _text
The text that can change in this Memento_TextObject class.
void RestoreMemento(IMemento memento)
Sets the text in this class instance to the snapshot stored in the given IMemento object (which is as...
Memento_TextObject(string text)
Constructs a text object with an initial string.
override string ToString()
Converts the Memento_TextObject to a string (makes it easier to use the class in string formatting).
string Text
Gets or sets the text in this TextObject.
IMemento GetMemento(string operationName)
Returns an IMemento object containing a snapshot of the text stored in this class instance.