private void UpdateIndividual(IndividualClass person, TreeViewLayout layout, ref IndividualButton personButton, FamilyButton parentButton = null) { trace.TraceInformation("UpdateIndividual(" + person.GetXrefName() + "),gen:" + personButton.bLayout.generation + ",name:" + person.GetPersonalName().GetName()); if (personButton.individual == null) { personButton.individual = person; personButton.Refresh(); } if (!personButton.Visible) { if (!personButton.SetLayout(layout, parentButton)) { trace.TraceInformation("UpdateIndividual(" + person.GetXrefName() + "),gen:" + personButton.bLayout.generation + ")-aborted,hidden"); return; } } if (layout.VisibleButton(personButton.bLayout)) { if (layout.SearchChildren()) { UpdateFamilyList(person.GetFamilySpouseList(), personButton); } if (layout.SearchParents()) { UpdateFamilyList(person.GetFamilyChildList(), personButton); } trace.TraceInformation("UpdateIndividual(" + person.GetXrefName() + ", " + personButton.bLayout.generation + ")-done"); } else { trace.TraceInformation("UpdateIndividual(" + person.GetXrefName() + ", " + personButton.bLayout.generation + ") not visible generation => stop!"); } }
private void UpdateIndividualList(IList <IndividualXrefClass> personList, FamilyButton familyButton) { if (personList != null) { foreach (IndividualXrefClass personXref in personList) { if (!personControlList.ContainsKey(personXref.GetXrefName())) { IndividualButton personButton = new IndividualButton(personXref.GetXrefName()); personButton.SetParent(this); personButton.SetLayout(layout, familyButton); personControlList.Add(personXref.GetXrefName(), personButton); mainPanel.Controls.Add(personButton); if (!personThreadList.ContainsKey(personXref.GetXrefName())) { FindPersonThread thread = new FindPersonThread(familyTree, personXref.GetXrefName(), new HandleNewIndividual(HandleNewIndividual_Function)); personThreadList.Add(personXref.GetXrefName(), thread); } } else { IndividualButton personButton = personControlList[personXref.GetXrefName()]; if (personButton.individual != null) { UpdateIndividual(personButton.individual, layout, ref personButton, familyButton); } else { if (personButton.SetLayout(layout, familyButton)) { if (!personThreadList.ContainsKey(personXref.GetXrefName())) { FindPersonThread thread = new FindPersonThread(familyTree, personXref.GetXrefName(), new HandleNewIndividual(HandleNewIndividual_Function)); personThreadList.Add(personXref.GetXrefName(), thread); } } } } } } }