コード例 #1
0
        public FamilyUnit(FamRecord fam)
        {
            FamRec  = fam;
            Husband = null;
            Wife    = null;
            Childs  = new List <IndiWrap>();

            DadFam = null;
            MomFam = null;
        }
コード例 #2
0
ファイル: BuildTree.cs プロジェクト: zhifu10001/YAGP
        private void Pass1(IEnumerable <GEDCommon> gedRecs)
        {
            // Wrap INDI and FAM records, collect into hashes

            _indiHash = new Dictionary <string, IndiWrap>();
            _famHash  = new Dictionary <string, FamilyUnit>();
            _childsIn = new MultiMap <string, FamilyUnit>();
            _issues   = new List <Issue>();

            foreach (var gedCommon in gedRecs) // TODO really need 'INDI', 'FAM' accessors
            {
                if (gedCommon is IndiRecord)
                {
                    var ident = (gedCommon as IndiRecord).Ident;

                    if (_indiHash.ContainsKey(ident))
                    {
                        MakeError(Issue.IssueCode.DUPL_INDI, ident);
                    }
                    else
                    {
                        IndiWrap iw = new IndiWrap();
                        iw.Indi  = gedCommon as IndiRecord;
                        iw.Ahnen = 0;
                        _indiHash.Add(ident, iw);

                        if (_firstPerson == null)
                        {
                            _firstPerson = ident;
                        }
                    }
                }

                // TODO GEDCOM_Amssoms.ged has a duplicate family "X0". Needs to be caught by validate, flag as error, and not reach here.
                if (gedCommon is FamRecord)
                {
                    var fam   = gedCommon as FamRecord;
                    var ident = fam.Ident;
                    if (string.IsNullOrEmpty(ident))
                    {
                        MakeError(Issue.IssueCode.MISS_FAMID, fam.BegLine);
                        continue;
                    }
                    if (!_famHash.ContainsKey(ident))
                    {
                        _famHash.Add(ident, new FamilyUnit(fam));
                    }
                    else
                    {
                        MakeError(Issue.IssueCode.DUPL_FAM, ident);
                    }
                }
            }
        }
コード例 #3
0
ファイル: BuildTree.cs プロジェクト: zhifu10001/YAGP
        private IndiWrap MakeFillerIndi(string ident, out IndiRecord hack)
        {
            // There is a reference to an individual who doesn't exist in
            // the GEDCOM. Create a placeholder.

            IndiWrap hack0 = new IndiWrap();

            // TODO need a library method to do this!!!
            hack = new IndiRecord(null, ident, null);
            var hack2 = new NameRec();

            hack2.Surname = "Missing";
            hack.Names.Add(hack2);
            hack0.Indi  = hack;
            hack0.Ahnen = -1;
            return(hack0);
        }