static void Main() { Duck Mallard = new MallardDuck(); Mallard.Kill += new EventHandler(Mallard_Kill); ShowDuck(Mallard, false,null,null); Console.WriteLine(); Console.WriteLine(Resources.StrRTCB); ShowDuck(Mallard,true,new FlyRocketPowered(),new Squeak()); Console.ReadLine(); }
static void Main(string[] args) { Duck mallard = new MallardDuck(); mallard.PerformQuack(); mallard.PerformFly(); Console.ReadLine(); Duck model = new ModelDuck(); model.PerformFly(); model.SetFlyBehavior(new FlyRocketPowered()); model.PerformFly(); Console.ReadLine(); }