// Return if a give course uses a given control. public static bool CourseUsesControl(EventDB eventDB, CourseDesignator courseDesignator, Id<ControlPoint> controlId) { eventDB.CheckControlId(controlId); foreach (Id<CourseControl> courseControlId in EnumCourseControlIds(eventDB, courseDesignator)) { if (eventDB.GetCourseControl(courseControlId).control == controlId) return true; } return false; }