static void Main(string[] args) { TrainSignal trainSignal = new TrainSignal(); new Car(trainSignal); new Car(trainSignal); new Car(trainSignal); new Car(trainSignal); new Car(trainSignal); trainSignal.del_run_this += null; trainSignal.TrainIsComing(); Console.Read(); }
public Car(TrainSignal trainSignal) { trainSignal.del_run_this += StopTheCar; }