private void UpdateFamily(FamilyClass family, TreeViewLayout layout, ref FamilyButton familyButton, IndividualButton parentButton = null) { trace.TraceInformation("UpdateFamily(" + family.GetXrefName() + "):" + familyButton.bLayout.generation); if (familyButton.family == null) { familyButton.family = family; familyButton.Refresh(); } if (!familyButton.Visible) { if (!familyButton.SetLayout(layout, parentButton)) { trace.TraceInformation("UpdateFamily(" + family.GetXrefName() + ")-aborted"); return; } //familyButton.Refresh(); } if (layout.VisibleButton(familyButton.bLayout)) { if (layout.SearchChildren()) { UpdateIndividualList(family.GetChildList(), familyButton); } if (layout.SearchParents()) { UpdateIndividualList(family.GetParentList(), familyButton); } trace.TraceInformation("UpdateFamily(" + family.GetXrefName() + ")-done"); } else { trace.TraceInformation("UpdateFamily(" + family.GetXrefName() + "," + familyButton.bLayout.generation + ") not visible generation => stop!"); } }
private void UpdateFamilyList(IList <FamilyXrefClass> familyList, IndividualButton personButton) { if (familyList != null) { foreach (FamilyXrefClass familyXref in familyList) { if (!familyControlList.ContainsKey(familyXref.GetXrefName())) { FamilyButton familyButton = new FamilyButton(familyXref.GetXrefName()); familyButton.SetParent(this); familyButton.SetLayout(layout, personButton); familyControlList.Add(familyXref.GetXrefName(), familyButton); mainPanel.Controls.Add(familyButton); if (!familyThreadList.ContainsKey(familyXref.GetXrefName())) { FindFamilyThread thread = new FindFamilyThread(familyTree, familyXref.GetXrefName(), new HandleNewFamily(HandleNewFamily_Function)); familyThreadList.Add(familyXref.GetXrefName(), thread); } } else { FamilyButton familyButton = familyControlList[familyXref.GetXrefName()]; if (familyButton.family != null) { UpdateFamily(familyButton.family, layout, ref familyButton, personButton); } else { if (familyButton.SetLayout(layout, personButton)) { if (!familyThreadList.ContainsKey(familyXref.GetXrefName())) { FindFamilyThread thread = new FindFamilyThread(familyTree, familyXref.GetXrefName(), new HandleNewFamily(HandleNewFamily_Function)); familyThreadList.Add(familyXref.GetXrefName(), thread); } } } } } } }