Exemple #1
0
        static void Main(string[] args)
        {
            ParkHouseMonitor parkHouseMonitor = new ParkHouseMonitor(9, 3, 3);
            OutGoing outgoing = new OutGoing(parkHouseMonitor);
            InComing incoming = new InComing(parkHouseMonitor);
            Thread outgoingThread = new Thread(new ThreadStart(outgoing.RunCar));
            Thread incomingThread = new Thread(new ThreadStart(incoming.RunCar));
            outgoingThread.Start();
            incomingThread.Start();

            OutGoing outgoing2 = new OutGoing(parkHouseMonitor);
            InComing incoming2 = new InComing(parkHouseMonitor);
            Thread outgoingThread3 = new Thread(new ThreadStart(outgoing2.RunTruck));
            Thread incomingThread3 = new Thread(new ThreadStart(incoming2.RunTruck));
            outgoingThread3.Start();
            incomingThread3.Start();

            OutGoing outgoing3 = new OutGoing(parkHouseMonitor);
            InComing incoming3 = new InComing(parkHouseMonitor);
            Thread outgoingThread2 = new Thread(new ThreadStart(outgoing3.RunDisabled));
            Thread incomingThread2 = new Thread(new ThreadStart(incoming3.RunDisabled));
            outgoingThread2.Start();
            incomingThread2.Start();

            System.Console.ReadLine();

            incoming.Stop();
            outgoing.Stop();
            incoming2.Stop();
            outgoing2.Stop();

            System.Console.ReadLine();
        }
Exemple #2
0
 public OutGoing(ParkHouseMonitor parkHouseMonitor)
 {
     this.parkHouseMonitor = parkHouseMonitor;
 }
Exemple #3
0
 public InComing(ParkHouseMonitor phusMonitor)
 {
     this.parkhouseMonitor = phusMonitor;
 }