public DeleteCommand(Receiver receiver) { _receiver = receiver; }
public UpdateCommand(Receiver receiver) { _receiver = receiver; }
static void Main(string[] args) { Console.Title = "Command Pattern Demo"; Receiver rec = new Receiver(); ICommand insert = new InsertCommand(rec); ICommand update = new UpdateCommand(rec); ICommand delete = new DeleteCommand(rec); Invoker inv = new Invoker(); inv.ExecuteCommand(insert); inv.ExecuteCommand(update); inv.ExecuteCommand(delete); }
public InsertCommand(Receiver receiver) { _receiver = receiver; }