internal override void Buy() { if (rbPerson==null) { rbPerson = new RealBuyPerson(); } rbPerson.Buy(); Console.WriteLine("帮你买了一部Iphone6s"); }
internal override void Buy() { if (rbPerson == null) { rbPerson = new RealBuyPerson(); } rbPerson.Buy(); Console.WriteLine("帮你买了一部Iphone6s"); }
public override void BuyProduct() { if (_realSubject == null) { _realSubject = new RealBuyPerson(); } this.PreButProduct(); _realSubject.BuyProduct(); this.PostBuyProduct(); }
public override void BuyProduct() { Console.WriteLine("通过代理类方位真实实体对象的方法"); if (realSubject == null) { realSubject = new RealBuyPerson(); } this.PreBuyProduct(); realSubject.BuyProduct(); this.PostBuyProduct(); }