static void Main(string[] args) { IStractoryPay isp = new DollarPay(); StractoryContext context = new StractoryContext("zhangsan", 3000, isp); context.SetUp(); IStractoryPay ispRmp = new RenMinbiPay(); StractoryContext contextRmp = new StractoryContext("lishi", 2000, ispRmp); contextRmp.SetUp(); }
/// <summary> /// 我的支付方式 /// </summary> /// <param name="context"></param> public void Pay(StractoryContext context) { Console.WriteLine(context.GetUserName() + context.GetUserMoney() + "通过账户转了....."); }