static void Main(string[] args) { //桥接模式 Abstraction straction = new RefinedAbstraction(); straction.SetImplementor(new ConcreteImplementorA()); straction.Operation(); straction.SetImplementor(new ConcreteImplementorB()); straction.Operation(); Console.WriteLine("----------------------------------------"); HandsetBrand hb; hb = new HandsetBrandN(); hb.SetHandsetSoft(new Handsetgame()); hb.Run(); hb.SetHandsetSoft(new HandsetAddressList()); hb.Run(); hb = new HandsetBrandM(); hb.SetHandsetSoft(new Handsetgame()); hb.Run(); hb.SetHandsetSoft(new HandsetAddressList()); hb.Run(); Console.Read(); }
static void Main(string[] args) { Abstraction ab = new RefinedAbstraction(); ab.SetImplementor(new ConcreteImplementorA()); ab.Operation(); ab.SetImplementor(new ConcreteImplementorB()); ab.Operation(); Console.Read(); }