Beispiel #1
0
 public override void BuyProduct(AbroadShop shop)
 {
     if (!shop.checkAbroad(this))
     {
         Console.WriteLine("我无法出国购买奶粉!");
     }
 }
Beispiel #2
0
 public override void BuyProduct(AbroadShop shop)
 {
     if (!shop.checkAbroad(this))
     {
         Console.WriteLine("我也未出国");
         return;
     }
     Console.WriteLine("我成功到达海外商店!");
     Console.WriteLine("我正在代购清单物品...");
     Console.WriteLine("购买结束!不负众望!");
 }
Beispiel #3
0
        public void AppMain()
        {
            AbroadShop ashop = new AbroadShop();

            RealBuyPerson me = new RealBuyPerson("小王");

            me.BuyProduct(ashop);
            Console.WriteLine();

            AbroadProxy friend = new AbroadProxy("代理小陈");

            me.CallProxyBuySomethings(friend, "奶粉");
            friend.GoAbroad();
            friend.PrintOrders();
            friend.BuyProduct(ashop);
        }
Beispiel #4
0
 public abstract void BuyProduct(AbroadShop shop);