Open main menu

CDOT Wiki β

Changes

Command

527 bytes added, 12:23, 14 April 2007
Code Examples
= Code Examples =
== Java C++ == Here is an example of a command pattern used in a text editor (menu bar) // Imaginary example of a command object used with a text editor
class EditorCommandInterface { public: virtual void execute(TextEditor& target) =0; virtual ~EditorCommandInterface() { }}; class CutCommand : public EditorCommandInterface { public: virtual void execute(TextEditor& target) { string s = C++ ==target.GetSelectedText(); target.DeleteRange(target.GetSelectStart(), target.GetSelectEnd()); Clipboard.Copy(s); }};
93
edits