Exemple #1
0
    /// <summary>
    /// Entry point into console application.
    /// </summary>
    static void Main()
    {
      // Create receiver, command, and invoker
      Receiver receiver = new Receiver();
      Command command = new ConcreteCommand(receiver);
      Invoker invoker = new Invoker();
 
      // Set and execute command
      invoker.SetCommand(command);
      invoker.ExecuteCommand();
 
      // Wait for user
      Console.ReadKey();
    }
Exemple #2
0
 // Constructor
 public ConcreteCommand(Receiver receiver)
     : base(receiver)
 {
 }
Exemple #3
0
 // Constructor
 public Command(Receiver receiver)
 {
     this.receiver = receiver;
 }
 // Constructor
 public ConcreteCommand(Receiver receiver) :
     base(receiver)
 {
 }
 // Constructor
 public Command(Receiver receiver)
 {
     this.receiver = receiver;
 }