public static void RemoveElevator(Elevator elevator) { if (elevators.TryRemove(elevator.GetHashCode(), out elevator)) { Console.WriteLine("-" + elevator + " is OUT OFF Service."); } }
public static void AddElevator(Elevator elevator) { if (elevators.TryAdd(elevator.GetHashCode(), elevator)) { Console.WriteLine("+" + elevator + " is IN Service."); } }