Represents a single memento (snapshot) of the text state before an operation is applied.
None __init__(self, str name, str text)
Constructor.
_name
The name of this memento (really just the name of the operation that triggered the need for this meme...
str Name(self)
Property getter for the name of this memento: value = o.Name.
_text
The snapshot of the text data as stored in the Memento_TextObject class instance.
str ToString(self)
Converts the Memento_TextObject to a string (makes it easier to use the class in string formatting).
None __init__(self, str text)
Constructs a text object with an initial string.
_text
The text that can change in this Memento_TextObject class.
None RestoreMemento(self, IMemento memento)
Sets the text in this class instance to the snapshot stored in the given IMemento object (which is as...
IMemento GetMemento(self, str operationName)
Returns an IMemento object containing a snapshot of the text stored in this class instance.