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(); }