/// <summary> /// Put all desired Children info out on the form. /// </summary> /// <param name="pBasePerson">Original Person we are looking at.</param> private void reportChildrenData(FamilyTreePersonState pBasePerson) { PersonChildrenState myChildren = pBasePerson.ReadChildren(); //Display a headline. listBoxDisplayFacts.Items.Add("Children Facts"); //Look for Children. foreach (var childFound in myChildren.Persons ?? new List <Person>()) { //Display all Child Facts on the form. displayAllChildFacts(childFound); } }
/// <summary> /// Put all desired Parent info out on the form. /// </summary> /// <param name="pBasePerson">Original Person we are looking at.</param> private void reportParentData(FamilyTreePersonState pBasePerson) { //Get the parents. PersonParentsState myParents = pBasePerson.ReadParents(); //Look in myParents.Persons for parents, names, and dates. foreach (var parentFound in myParents.Persons ?? new List <Person>()) { //Display all Father Facts on the form. displayAllFatherFacts(parentFound, pBasePerson); //Display all Mother Facts on the form. displayAllMotherFacts(parentFound, pBasePerson); } }
/// <summary> /// Put all desired Spouse info out on the form. /// </summary> /// <param name="pBasePerson">Original Person we are looking at.</param> private void reportSpouseData(FamilyTreePersonState pBasePerson) { //Get the parents. PersonSpousesState mySpouses = pBasePerson.ReadSpouses(); //Display a headline. listBoxDisplayFacts.Items.Add("Spouse Facts"); //Look in mySpuses.Persons for Spouses. foreach (var spouseFound in mySpouses.Persons ?? new List <Person>()) { //Display all Spouse Facts on the form. displayAllSpouseFacts(spouseFound); } }
/// <summary> /// Main procedure to display some Facts about a Persons Family on the form. /// </summary> /// <param name="pPerson">Person whose family is to be displayed</param> private void showFamilyFacts(FamilyTreePersonState pPerson) { //Get a headline out including empty line. listBoxDisplayFacts.Items.Add("Family Facts for " + pPerson.Person.Id + " (" + pPerson.Person.DisplayExtension.Name + ")" + " Lifespan " + pPerson.Person.DisplayExtension.Lifespan); //Add a little separation after displaying headline. listBoxDisplayFacts.Items.Add(" "); //Display Parents. reportParentData(pPerson); //Display Spouses. reportSpouseData(pPerson); //Display Children. reportChildrenData(pPerson); }
/// <summary> /// Display all Father Facts /// </summary> /// <param name="parentFound">A parent that ws found.</param> /// <param name="pFTPerson">The original Familytree Person.</param> private void displayAllFatherFacts(Person parentFound, FamilyTreePersonState pFTPerson) { //Look at Father Facts only if (parentFound.Gender.KnownType == GenderType.Male) { //Show Father headline. listBoxDisplayFacts.Items.Add("Father: " + parentFound.Id + " (" + parentFound.DisplayExtension.Name + ")" + " Lifespan " + parentFound.DisplayExtension.Lifespan); //Read Relationships. foreach (var relationship in pFTPerson.ChildAndParentsRelationships ?? new List <ChildAndParentsRelationship>()) { //Display Father Relationship facts on form. displayFatherRelationship(relationship); } //Add a little separation after displaying facts. listBoxDisplayFacts.Items.Add(" "); } }