Exemple #1
0
        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();
        }
Exemple #2
0
 public Car(TrainSignal trainSignal)
 {
     trainSignal.del_run_this += StopTheCar;
 }