public void Test_AddWebPage1() { string value = "http://www.bitboost.com/ref/international-address-formats/russia/"; GEDCOMAddress instance = (GEDCOMAddress)GEDCOMAddress.Create(null, null, "", ""); instance.AddWebPage(value); GEDCOMList <GEDCOMTag> wp = instance.WebPages; Assert.AreEqual(1, wp.Count); string res = wp.Extract(0).StringValue; Assert.AreEqual(res, value); }
public void Test_AddFaxNumber() { string value = "(214) 748-3647"; GEDCOMAddress instance = (GEDCOMAddress)GEDCOMAddress.Create(null, null, "", ""); instance.AddFaxNumber(value); GEDCOMList <GEDCOMTag> pl = instance.FaxNumbers; Assert.AreEqual(1, pl.Count); string res = pl.Extract(0).StringValue; Assert.AreEqual(res, value); }
public void Test_AddEmailAddress() { string value = "*****@*****.**"; GEDCOMAddress instance = (GEDCOMAddress)GEDCOMAddress.Create(null, null, "", ""); instance.AddEmailAddress(value); GEDCOMList <GEDCOMTag> pl = instance.EmailAddresses; Assert.AreEqual(1, pl.Count); string res = pl.Extract(0).StringValue; Assert.AreEqual(res, value); }
public override void MoveTo(GEDCOMRecord targetRecord, bool clearDest) { GEDCOMSourceRecord targetSource = targetRecord as GEDCOMSourceRecord; if (targetSource == null) { throw new ArgumentException(@"Argument is null or wrong type", "targetRecord"); } StringList titl = new StringList(); StringList orig = new StringList(); StringList publ = new StringList(); StringList text = new StringList(); try { titl.Text = (targetSource.Title.Text + "\n" + Title.Text).Trim(); orig.Text = (targetSource.Originator.Text + "\n" + Originator.Text).Trim(); publ.Text = (targetSource.Publication.Text + "\n" + Publication.Text).Trim(); text.Text = (targetSource.Text.Text + "\n" + Text.Text).Trim(); DeleteTag("TITL"); DeleteTag("TEXT"); DeleteTag("ABBR"); DeleteTag("PUBL"); DeleteTag("AUTH"); base.MoveTo(targetRecord, clearDest); targetSource.Title = titl; targetSource.Originator = orig; targetSource.Publication = publ; targetSource.Text = text; while (fRepositoryCitations.Count > 0) { GEDCOMRepositoryCitation obj = fRepositoryCitations.Extract(0); obj.ResetParent(targetSource); targetSource.RepositoryCitations.Add(obj); } } finally { titl.Dispose(); orig.Dispose(); publ.Dispose(); text.Dispose(); } }
public override void MoveTo(GEDCOMRecord targetRecord, bool clearDest) { GEDCOMRecordWithEvents target = targetRecord as GEDCOMRecordWithEvents; if (target == null) { throw new ArgumentException(@"Argument is null or wrong type", "targetRecord"); } base.MoveTo(targetRecord, clearDest); while (fEvents.Count > 0) { GEDCOMCustomEvent obj = fEvents.Extract(0); obj.ResetParent(target); target.AddEvent(obj); } }
public GEDCOMRecord Extract(int index) { XRefIndex_DeleteRecord(fRecords[index]); return(fRecords.Extract(index)); }
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); } }