Example #1
0
 /// <summary>
 /// Check whether the vehicle is parked.
 /// </summary>
 public static void TakeVehicle(Vehicle v)
 {
     if (VehicleViewer.IsParked(v.Id))
     {
         v.IsParked = false;
         Parking.GetInstance().vehicles.Remove(v);
     }
 }
Example #2
0
 /// <summary>
 /// Park vehicle and turn on meter.
 /// </summary>
 public void AddVehicle(Vehicle v)
 {
     if (Settings.capacity > Parking.GetInstance().vehicles.Count)
     {
         if (!VehicleViewer.IsParked(v.Id))
         {
             Parking.GetInstance().vehicles.Add(v);
             this.tm    = new TimerCallback(this.GetPaid);
             this.timer = new Timer(this.tm, v, 0, Settings.period);
         }
     }
 }