public bool HasChild(ICoatingScheduleLogic child) { if (ChildrenLogic.Contains(child)) { return(true); } bool childFound = false; for (Int32 index = 0; !childFound && index < ChildrenLogic.Count; index++) { var childLogic = ChildrenLogic[index]; childFound = childLogic.HasChild(child); } return(childFound); }
public Int32 IndexOfChild(ICoatingScheduleLogic child) { Int32 foundIndex = -1; if (ChildrenLogic.Contains(child)) { return(ChildrenLogic.IndexOf(child)); } for (Int32 index = 0; foundIndex == -1 && index < ChildrenLogic.Count; index++) { var childLogic = ChildrenLogic[index]; if (childLogic.HasChild(child)) { foundIndex = index; } } return(foundIndex); }