예제 #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;
            }
        }
예제 #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);
        }
예제 #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);
        }
예제 #4
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;
            }
        }
예제 #5
0
 public void ProcessNextLine(PropertyLine line)
 {
     // no implementation needed
 }