Container for a string. Need to use a class that allows the text to be changed while the container (this class) remains constant. This way, operations can be applied to the text and the container's contents change but not the container (strings are immutable in C#; this dances around that problem). More...
Public Member Functions | |
Command_TextObject (string text) | |
Constructs a text object with an initial string. | |
void | Reset () |
Resets the TextObject to the starting string. | |
override string | ToString () |
Converts the TextObject to a string. | |
Properties | |
string | Text [get, set] |
Gets or sets the text in this TextObject. | |
Private Attributes | |
string | _startingText |
string | _text |
Container for a string. Need to use a class that allows the text to be changed while the container (this class) remains constant. This way, operations can be applied to the text and the container's contents change but not the container (strings are immutable in C#; this dances around that problem).
Definition at line 18 of file Command.cs.
|
inline |
Constructs a text object with an initial string.
text | The initial string for the text object. |
Definition at line 30 of file Command.cs.
References Command_TextObject._startingText, and Command_TextObject._text.
|
inline |
Resets the TextObject to the starting string.
Definition at line 54 of file Command.cs.
References Command_TextObject._startingText, and Command_TextObject._text.
Referenced by Command_Exercise.Command_Undo().
|
inline |
Converts the TextObject to a string.
Definition at line 64 of file Command.cs.
References Command_TextObject._text.
|
private |
Definition at line 21 of file Command.cs.
Referenced by Command_TextObject.Command_TextObject(), and Command_TextObject.Reset().
|
private |
Definition at line 24 of file Command.cs.
Referenced by Command_TextObject.__init__(), Memento_TextObject.__init__(), Command_TextObject.Command_TextObject(), Memento_TextObject.GetMemento(), Command_TextObject.Reset(), Memento_TextObject.RestoreMemento(), Command_TextObject.Text(), Memento_TextObject.Memento.Text(), Memento_TextObject.Text(), Command_TextObject.ToString(), and Memento_TextObject.ToString().
|
getset |
Gets or sets the text in this TextObject.
Definition at line 39 of file Command.cs.
Referenced by Command_Exercise.Command_Operation_Replace(), and Command_Exercise.Command_Operation_Reverse().