Exemplo n.º 1
0
        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;
            }
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }