private static int EventsCompare(GEDCOMPointer cp1, GEDCOMPointer cp2) { UDN udn1 = ((GEDCOMIndividualRecord)cp1.Value).GetUDN("BIRT"); UDN udn2 = ((GEDCOMIndividualRecord)cp2.Value).GetUDN("BIRT"); return(udn1.CompareTo(udn2)); }
private static int EventsCompare(GEDCOMPointer cp1, GEDCOMPointer cp2) { UDN udn1 = ((GEDCOMFamilyRecord)cp1.Value).GetUDN("MARR"); UDN udn2 = ((GEDCOMFamilyRecord)cp2.Value).GetUDN("MARR"); return(udn1.CompareTo(udn2)); }
public override void MoveTo(GEDCOMRecord targetRecord, bool clearDest) { GEDCOMFamilyRecord targetFamily = targetRecord as GEDCOMFamilyRecord; if (targetFamily == null) { throw new ArgumentException(@"Argument is null or wrong type", "targetRecord"); } base.MoveTo(targetRecord, clearDest); while (fChildren.Count > 0) { GEDCOMPointer obj = fChildren.Extract(0); obj.ResetParent(targetFamily); targetFamily.Children.Add(obj); } while (fSpouseSealings.Count > 0) { GEDCOMSpouseSealing obj = fSpouseSealings.Extract(0); obj.ResetParent(targetFamily); targetFamily.SpouseSealings.Add(obj); } }
public bool AddCommunication(GEDCOMCommunicationRecord commRecord) { bool result = false; if (commRecord != null) { GEDCOMPointer ptr = new GEDCOMPointer(Owner, this, "", ""); ptr.SetNamedValue("_COMM", commRecord); fCommunications.Add(ptr); result = true; } return(result); }
public bool AddGroup(GEDCOMGroupRecord groupRecord) { bool result = false; if (groupRecord != null) { GEDCOMPointer ptr = new GEDCOMPointer(Owner, this, "", ""); ptr.SetNamedValue("_GROUP", groupRecord); fGroups.Add(ptr); result = true; } return(result); }
public bool AddTask(GEDCOMTaskRecord taskRecord) { bool result = false; if (taskRecord != null) { GEDCOMPointer ptr = new GEDCOMPointer(Owner, this, "", ""); ptr.SetNamedValue("_TASK", taskRecord); fTasks.Add(ptr); result = true; } return(result); }
public bool AddMember(GEDCOMIndividualRecord member) { if (member == null) { return(false); } GEDCOMPointer ptr = new GEDCOMPointer(Owner, this, "", ""); ptr.SetNamedValue("_MEMBER", member); fMembers.Add(ptr); ptr = new GEDCOMPointer(Owner, member, "", ""); ptr.SetNamedValue("_GROUP", this); member.Groups.Add(ptr); return(true); }
public bool AddChild(GEDCOMIndividualRecord child) { if (child == null) { return(false); } GEDCOMPointer ptr = new GEDCOMPointer(Owner, this, "", ""); ptr.SetNamedValue("CHIL", child); fChildren.Add(ptr); GEDCOMChildToFamilyLink chLink = new GEDCOMChildToFamilyLink(Owner, child, "", ""); chLink.Family = this; child.ChildToFamilyLinks.Add(chLink); return(true); }
public override void MoveTo(GEDCOMRecord targetRecord, bool clearDest) { GEDCOMIndividualRecord toRec = targetRecord as GEDCOMIndividualRecord; if (toRec == null) { throw new ArgumentException(@"Argument is null or wrong type", "targetRecord"); } if (!clearDest) { DeleteTag("SEX"); DeleteTag("_UID"); } base.MoveTo(targetRecord, clearDest); while (fPersonalNames.Count > 0) { GEDCOMPersonalName obj = fPersonalNames.Extract(0); obj.ResetParent(toRec); toRec.AddPersonalName(obj); } if (toRec.ChildToFamilyLinks.Count == 0 && ChildToFamilyLinks.Count != 0 && fChildToFamilyLinks != null) { GEDCOMChildToFamilyLink ctfLink = fChildToFamilyLinks.Extract(0); GEDCOMFamilyRecord family = ctfLink.Family; int num = family.Children.Count; for (int i = 0; i < num; i++) { GEDCOMPointer childPtr = family.Children[i]; if (childPtr.StringValue == "@" + XRef + "@") { childPtr.StringValue = "@" + targetRecord.XRef + "@"; } } ctfLink.ResetParent(toRec); toRec.ChildToFamilyLinks.Add(ctfLink); } while (fSpouseToFamilyLinks.Count > 0) { GEDCOMSpouseToFamilyLink stfLink = fSpouseToFamilyLinks.Extract(0); GEDCOMFamilyRecord family = stfLink.Family; string targetXRef = "@" + targetRecord.XRef + "@"; if (family.Husband.StringValue == "@" + XRef + "@") { family.Husband.StringValue = targetXRef; } else if (family.Wife.StringValue == "@" + XRef + "@") { family.Wife.StringValue = targetXRef; } stfLink.ResetParent(toRec); toRec.SpouseToFamilyLinks.Add(stfLink); } while (fIndividualOrdinances.Count > 0) { GEDCOMIndividualOrdinance ord = fIndividualOrdinances.Extract(0); ord.ResetParent(toRec); toRec.IndividualOrdinances.Add(ord); } while (fSubmittors.Count > 0) { GEDCOMPointer obj = fSubmittors.Extract(0); obj.ResetParent(toRec); toRec.Submittors.Add(obj); } while (fAssociations.Count > 0) { GEDCOMAssociation obj = fAssociations.Extract(0); obj.ResetParent(toRec); toRec.Associations.Add(obj); } while (fAliasses.Count > 0) { GEDCOMAlias obj = fAliasses.Extract(0); obj.ResetParent(toRec); toRec.Aliases.Add(obj); } while (fAncestorsInterest.Count > 0) { GEDCOMPointer obj = fAncestorsInterest.Extract(0); obj.ResetParent(toRec); toRec.AncestorsInterest.Add(obj); } while (fDescendantsInterest.Count > 0) { GEDCOMPointer obj = fDescendantsInterest.Extract(0); obj.ResetParent(toRec); toRec.DescendantsInterest.Add(obj); } while (fGroups.Count > 0) { GEDCOMPointer obj = fGroups.Extract(0); obj.ResetParent(toRec); toRec.Groups.Add(obj); } }