/// <summary> /// Remove airplanes and ADI. /// </summary> public void RemoveHelperModels() { if (adi != null) { Models.Remove(adi); adi = null; } if (airplanes != null) { Models.Remove(airplanes[0]); Models.Remove(airplanes[1]); airplanes = null; } }
/// <summary> /// Show/hide airplanes or ADI. /// </summary> public void ToggleHelperModels() { if (airplanes == null) { airplanes = new Airplane[2]; Models.Add(airplanes[0] = new Airplane()); Models.Add(airplanes[1] = new Airplane()); } else { if (adi == null) { adi = new ADI(); Models.Add(adi); } else { RemoveHelperModels(); } } UpdateHelperModels(); }