November 2019
Beginner to intermediate
674 pages
15h
English
All commands are subclasses of the TCommand class, as shown in the following code:
type TCommand = class strict private FReceiver: TMemo; public constructor Create(receiver: TMemo); function Clone: TCommand; virtual; procedure Execute; virtual; procedure Undo; virtual; property Receiver: TMemo read FReceiver write FReceiver; end;
Each command knows about the intended receiver, which is injected into the constructor. The receiver can also be changed later this functionality is used when replaying macros.
Each command implements the Execute (executes the command) and Undo (undoes effects of command execution) methods. In the TCommand object, both are implemented as empty methods.
Each command also knows how to make a copy of itself. ...
Read now
Unlock full access