Пример #1
0
 public DeleteCommand(Receiver receiver)
 {
     _receiver = receiver;
 }
Пример #2
0
 public UpdateCommand(Receiver receiver)
 {
     _receiver = receiver;
 }
Пример #3
0
        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);
        }
Пример #4
0
 public InsertCommand(Receiver receiver)
 {
     _receiver = receiver;
 }