public IEnumerable <ApplicationContainer> Gears(bool skipStopped = true) { List <ApplicationContainer> gearSet = new List <ApplicationContainer>(); if (this.Uuids != null) { foreach (string uuid in Uuids) { ApplicationContainer gear = ApplicationContainer.GetFromUuid(uuid); // TODO check gear stoplock if (skipStopped && gear.StopLock) { throw new InvalidOperationException(string.Format("Gear is locked: {0}")); } gearSet.Add(gear); } } else { gearSet = ApplicationContainer.All(null, false).ToList(); } foreach (ApplicationContainer gear in gearSet) { try { // TODO check stop lock again if (skipStopped && gear.StopLock) { continue; } } catch (Exception ex) { Logger.Error("Gear evaluation failed for: {0}", gear.Uuid); Logger.Error("Exception: {0} - {1}", ex.Message, ex.StackTrace); } yield return(gear); } }