static void Main(string[] args) { ICar car = new M3(); car.CarStopped += new EventHandler(OnCarStopped); car.Start(); car.PressAccelerator(10); car.PressBrake(10); }
private static void CarStoppedDelegate() { ICar car = new M3(); car.CarStopped += OnCarStopped; car.Start(); car.PressAccelerate(10); car.PressBrake(10); }