CodePlexProject Hosting for Open Source Software
An unexpected error has occured.
There is an unsaved comment in progress. You will lose your changes if you continue. Are you sure you want to reopen the work item?
Voted
No files are attached
spyhunter99 wrote Jul 4, 2011 at 12:23 AM
XmlNodeList list = node.SelectNodes("OBJE"); //AO added //this should be a list of OBJE references to xml nodes, siblings of node, that with matching values /* * <INDI Value="@I54@"> <NAME Value="name" /> <SEX Value="F" /> <OBJE Value="@M3@" /> </INDI> <OBJE Value="@M3@"> <FILE Value="D:/My Documents/Downloads/family tree/birth/name.jpg"> <FORM Value="jpg" /> <TITL Value="" /> </FILE> </OBJE> * */ photos = new string[list.Count]; for (int i = 0; i < list.Count; i++) photos[i] = GetFile(list[i], node.ParentNode); return photos;
try { string value = GetValue(node, xpath); if (!string.IsNullOrEmpty(value)) { try { return DateTime.Parse(value, CultureInfo.InvariantCulture); } catch { } //forgot about date qualifiers try { if (value.StartsWith("ABT") || value.StartsWith("EST") || value.StartsWith("CAL") || value.StartsWith("BEF")) return DateTime.Parse(value.Substring(4, value.Length - 4), CultureInfo.InvariantCulture); } catch { } //could be just a year if (value.Trim().Length == 4) try { return new DateTime(Int32.Parse(value), 1, 1); } catch { } string[] stuff = value.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); if (stuff == null || stuff.Length == 0) return null; else { for (int i = 0; i < stuff.Length; i++) { if (stuff[i].Trim().Length == 4) { return new DateTime(Int32.Parse(stuff[i].Trim()), 1, 1); } } } } } catch { // The date is invalid, ignore and continue processing. } return result;
spyhunter99 wrote Jul 4, 2011 at 1:10 AM
spyhunter99 wrote Jul 6, 2011 at 12:17 PM
spyhunter99 wrote Jul 13, 2011 at 12:23 AM
{ // Single parent, add the child to the person case 0: family.AddChild(person, child, ParentChildModifier.Natural); break; // Has existing spouse, add the child to the person's spouse as well. case 1: //here's the problem family.AddChild(person, child, ParentChildModifier.Natural); family.AddChild(person.Spouses[0], child, ParentChildModifier.Natural); break; }
/// Performs the business logic for adding the Child relationship between two parents and the child. /// Added AO /// </summary> public static void AddChild(PeopleCollection family, Person husband, Person wife, Person child) { // Add the new child as a sibling to any existing children foreach (Person existingSibling in husband.Children) { //if (existingSibling.Parents.Contains(husband) && // !existingSibling.Parents.Contains(wife)) family.AddSibling(existingSibling, child); } // Add the new child as a sibling to any existing children foreach (Person existingSibling in wife.Children) { //if (existingSibling.Parents.Contains(husband) && // !existingSibling.Parents.Contains(wife)) family.AddSibling(existingSibling, child); } family.AddChild(husband, child, ParentChildModifier.Natural); family.AddChild(wife, child, ParentChildModifier.Natural); }
foreach (string child in children) { // Get the Person object for the child. Person childPerson = people.Find(child); //added AO if (childPerson != null) { if (husbandPerson != null && wifePerson != null) RelationshipHelper.AddChild(people, husbandPerson, wifePerson, childPerson); else if (husbandPerson == null && wifePerson != null) RelationshipHelper.AddChild(people, wifePerson, childPerson); else RelationshipHelper.AddChild(people, husbandPerson, childPerson); } }
Sign in to add a comment or to set email notifications
Keyboard shortcuts are available for this page.