public static AlarmSystem GetAlarm() { if (instance == null) { instance = new AlarmSystem(); } return(instance); }
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()); } }