示例#1
0
 public static AlarmSystem GetAlarm()
 {
     if (instance == null)
     {
         instance = new AlarmSystem();
     }
     return(instance);
 }
示例#2
0
 public void StartProduction(int quantity)
 {
     for (int i = 0; i < quantity; i++)
     {
         ManufactureParts();
         try
         {
             manufacturedChassis.Diagnostics();
             manufacturedEngine.Diagnostics();
             manufacturedBody.Diagnostics();
         }
         catch (Exception ex)
         {
             AlarmSystem.GetAlarm().Alarm(ex.Message);
         }
         actualVehicle = Assembly(manufacturedChassis, manufacturedBody, manufacturedEngine);
         manufacturedVehicles.Add(actualVehicle);
         Thread.Sleep(500);
         Console.WriteLine("[" + i + "]" + actualVehicle.ToString());
     }
 }