public void ProcessNextLine(PropertyLine line) { if (line.Level == 1) { // reset date state machine inMarriage = false; inDivorce = false; } switch (line.Keyword) { case "MARR": inMarriage = true; break; case "DIV": inDivorce = true; break; case "DATE": GeneaDate dt = GedcomDate.Parse(line.Value); if (dt != null) { if (inMarriage) { this.family.MarriageDate = dt; } else if (inDivorce) { this.family.DivorceDate = dt; } } break; case "PLAC": if (inMarriage) { this.family.MarriagePlace = line.Value; } else if (inDivorce) { this.family.DivorcePlace = line.Value; } break; case "CHIL": // 1 CHIL @I321@ long cid = GedcomUtil.GetIdFromReference(line.Value); this.children.Add(cid); break; case "WIFE": // fall through to HUSB case "HUSB": long sid = GedcomUtil.GetIdFromReference(line.Value); this.spouses.Add(sid); break; } }
public IndividualReader(PropertyLine startLine) { // assume line is like: "0 @I123@ INDI" if (startLine == null) { throw new ArgumentNullException(nameof(startLine)); } if (startLine.Value != "INDI") { throw new ArgumentException("This line should have the INDI type.", nameof(startLine)); } this.individual.Id = GedcomUtil.GetIdFromReference(startLine.Keyword); }
public FamilyReader(PropertyLine startLine) { // assume line is like: "0 @F123@ FAM" if (startLine == null) { throw new ArgumentNullException(nameof(startLine)); } if (startLine.Value != "FAM") { throw new ArgumentException("This line should have the FAM type.", nameof(startLine)); } this.family.Id = GedcomUtil.GetIdFromReference(startLine.Keyword); }