static void Main(string[] args)
        {
            Invoker invoker = new Invoker();

            invoker.SetOnStart(new TotalCost(100));
            InfoReceiver receiver = new InfoReceiver();

            invoker.CheckUserInfo();
            invoker.SetOnFinish(new PurchaseInfo(receiver, "John Doe", "454687631"));
        }
Exemple #2
0
        public CommandPatternStrategy()
        {
            Invoker invoker = new Invoker();

            invoker.SetOnStart(new TotalCost(100));
            InfoReceiver receiver = new InfoReceiver();

            invoker.CheckUserInfo();
            invoker.SetOnFinish(new PurchaseInfo(receiver, "John Doe", "454687631"));
        }
Exemple #3
0
 public PurchaseInfo(InfoReceiver infoReceiver, string userInfo, string cardInfo)
 {
     this._infoReceiver = infoReceiver;
     this._userInfo     = userInfo;
     this._cardInfo     = cardInfo;
 }