public static void Demo3() { var car = new Car{Model = "Polo"}; car.SuggestRoute(IsCool); IsConsideredACoolCar method = delegate(Car car1) { return car1.IsRolling; }; car.SuggestRoute(method); car.WasherFluidWarningLightWasLit += CarOnWasherFluidWarningLightWasLit; string line; while ((line = Console.ReadLine()) != null) { if (line == "Clean") car.CleanWindshield(); else break; } }
public Driver() { Car = new Car(); }
private static bool IsCool(Car car) { return car.Model == "Polo"; }