static void Main(string[] args) { Motorcycle moto = new Motorcycle(); MotorcycleNotifyHandler notifyHandler = new MotorcycleNotifyHandler(ShowMessage); moto.RegisterHandler(notifyHandler); moto.Move(1000); moto.Move(19500); Console.ReadKey(); }
public void RegisterHandler(MotorcycleNotifyHandler @delegate) { _handler = @delegate; }