/// <summary> /// Visits the name part. /// </summary> /// <param name="part">The name part to visit.</param> public override void VisitNamePart(Gx.Conclusion.NamePart part) { if (part.Id != null) { this.dictionary.Add(part.Id, part); } base.VisitNamePart(part); }
/** * Add a name part the list of name parts for this name form. * * @param part The name part to be added. */ public void AddPart(NamePart part) { if (part != null) { if (_parts == null) { _parts = new List <NamePart>(); } _parts.Add(part); } }
/** * Build up this name form with a part. * * @param part The part. * @return this. */ public NameForm SetPart(NamePart part) { AddPart(part); return(this); }
public virtual void VisitNamePart(NamePart part) { this.contextStack.Push(part); List<Field> fields = part.Fields; if (fields != null) { foreach (Field field in fields) { field.Accept(this); } } this.contextStack.Pop(); }
/// <summary> /// Visits the name part. /// </summary> /// <param name="part">The name part to visit.</param> public virtual void VisitNamePart(NamePart part) { this.contextStack.Push(part); if (part.Fields != null) { foreach (Field field in part.Fields) { VisitField(field); } } this.contextStack.Pop(); }
/** * Add a name part the list of name parts for this name form. * * @param part The name part to be added. */ public void AddPart(NamePart part) { if (part != null) { if (_parts == null) { _parts = new List<NamePart>(); } _parts.Add(part); } }
/** * Build up this name form with a part. * * @param part The part. * @return this. */ public NameForm SetPart(NamePart part) { AddPart(part); return this; }
public override void VisitNamePart(NamePart part) { BindIfNeeded(part); base.VisitNamePart(part); }
private Person CreateGeorge(PlaceDescription birthPlace, PlaceDescription deathPlace) { Person person = new Person(); person.SetGender(new Gender(GenderType.Male)); Fact fact = new Fact(); fact.SetId("123"); fact.SetType(FactType.Birth); fact.SetDate(new DateInfo()); fact.Date.SetOriginal("February 22, 1732"); fact.Date.SetFormal("+1732-02-22"); fact.SetPlace(new PlaceReference()); fact.Place.SetOriginal(birthPlace.Names[0].Value.ToLower()); fact.Place.DescriptionRef = "#" + birthPlace.Id; person.AddFact(fact); fact = new Fact(); fact.SetId("456"); fact.SetType(FactType.Death); fact.SetDate(new DateInfo()); fact.Date.SetOriginal("December 14, 1799"); fact.Date.SetFormal("+1799-12-14T22:00:00"); fact.SetPlace(new PlaceReference()); fact.Place.SetOriginal(deathPlace.Names[0].Value.ToLower()); fact.Place.DescriptionRef = "#" + deathPlace.Id; person.AddFact(fact); List<Name> names = new List<Name>(); Name name = new Name(); NameForm nameForm = new NameForm(); nameForm.SetFullText("George Washington"); List<NamePart> parts = new List<NamePart>(); NamePart part = new NamePart(); part.SetType(NamePartType.Given); part.SetValue("George"); parts.Add(part); part = new NamePart(); part.SetType(NamePartType.Surname); part.SetValue("Washington"); parts.Add(part); nameForm.Parts = parts; name.SetNameForm(nameForm); name.SetId("789"); names.Add(name); person.Names = names; person.SetId("BBB-BBBB"); return person; }
private Person CreateMartha(PlaceDescription birthPlace, PlaceDescription deathPlace) { Person person = new Person(); person.SetGender(new Gender(GenderType.Male)); Fact fact = new Fact(); fact.SetId("321"); fact.SetType(FactType.Birth); fact.SetDate(new DateInfo()); fact.Date.SetOriginal("June 2, 1731"); fact.Date.SetFormal("+1731-06-02"); fact.SetPlace(new PlaceReference()); fact.Place.SetOriginal(birthPlace.Names[0].Value.ToLower()); fact.Place.DescriptionRef = "#" + birthPlace.Id; person.AddFact(fact); fact = new Fact(); fact.SetId("654"); fact.SetType(FactType.Death); fact.SetDate(new DateInfo()); fact.Date.SetOriginal("May 22, 1802"); fact.Date.SetFormal("+1802-05-22"); fact.SetPlace(new PlaceReference()); fact.Place.SetOriginal(deathPlace.Names[0].Value.ToLower()); fact.Place.DescriptionRef = "#" + deathPlace.Id; person.AddFact(fact); List<Name> names = new List<Name>(); Name name = new Name(); NameForm nameForm = new NameForm(); nameForm.SetFullText("Martha Dandridge Custis"); List<NamePart> parts = new List<NamePart>(); NamePart part = new NamePart(); part.SetType(NamePartType.Given); part.SetValue("Martha Dandridge"); parts.Add(part); part = new NamePart(); part.SetType(NamePartType.Surname); part.SetValue("Custis"); parts.Add(part); nameForm.Parts = parts; name.SetNameForm(nameForm); name.SetId("987"); names.Add(name); person.Names = names; person.SetId("CCC-CCCC"); return person; }