void AddElementWithChildren(GUIElement element) { requireReSort = true; // Add this element if (!AllSorted.Contains(element)) { AllSorted.Add(element); } // Add this element's children for (int i = 0; i < element.Children.Count; i++) { AddElementWithChildren(element.Children[i]); } }
/// <summary> /// Place participants into their groups. /// </summary> public void PlaceParticipantsIntoGroups() { foreach (int index in RandomizedIndex) { AllSorted.Add(All[index]); } for (int unorderIndex = 0; unorderIndex < this.NumberOfParticipants; unorderIndex++) { if (unorderIndex < this.ParticipantsPerGroup) { this.AllStarterHosts.Add(this.AllSorted[this.RandomizedIndex[unorderIndex]]); } else if (unorderIndex < this.ParticipantsPerGroup * 2) { this.AllMaincourseHosts.Add(this.AllSorted[RandomizedIndex[unorderIndex]]); } else { this.AllDesertHosts.Add(this.AllSorted[RandomizedIndex[unorderIndex]]); } } }