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;
            }
        }
Exemple #2
0
        public void ProcessNextLine(PropertyLine line)
        {
            if (line.Level == 1)
            {
                // reset state machine
                inBirth = false;
                inDeath = false;
            }

            switch (line.Keyword)
            {
            case "NAME":
                ProcessName(line.Value);
                break;

            case "SEX":
                switch (line.Value)
                {
                case "M":
                    this.individual.Sex = Support.Sex.Male;
                    break;

                case "F":
                    this.individual.Sex = Support.Sex.Female;
                    break;
                }
                break;

            case "BIRT":
                inBirth = true;
                break;

            case "DEAT":
                inDeath = true;
                break;

            case "DATE":
                GeneaDate dt = GedcomDate.Parse(line.Value);
                if (dt != null)
                {
                    if (inBirth)
                    {
                        this.individual.BirthDate = dt;
                    }
                    else if (inDeath)
                    {
                        this.individual.DeathDate = dt;
                    }
                }
                break;

            case "PLAC":
                if (inBirth)
                {
                    this.individual.BirthPlace = line.Value;
                }
                else if (inDeath)
                {
                    this.individual.DeathPlace = line.Value;
                }
                break;
            }
        }