Пример #1
0
        private void CheckIndividualRecord(GDMIndividualRecord iRec)
        {
            if (iRec.HasEvents)
            {
                for (int i = 0, num = iRec.Events.Count; i < num; i++)
                {
                    GDMCustomEvent evt = iRec.Events[i];

                    CheckEvent(evt);

                    fBaseContext.CollectEventValues(evt);
                }
            }

            for (int i = 0, num = iRec.PersonalNames.Count; i < num; i++)
            {
                CheckPersonalName(iRec.PersonalNames[i]);
            }

            for (int i = iRec.ChildToFamilyLinks.Count - 1; i >= 0; i--)
            {
                var cfl = iRec.ChildToFamilyLinks[i];
                if (fTree.GetPtrValue(cfl) == null)
                {
                    iRec.ChildToFamilyLinks.DeleteAt(i);
                }
                else
                {
                    CheckPointerWithNotes(cfl);
                }
            }

            for (int i = iRec.SpouseToFamilyLinks.Count - 1; i >= 0; i--)
            {
                var sfl = iRec.SpouseToFamilyLinks[i];
                if (fTree.GetPtrValue(sfl) == null)
                {
                    iRec.SpouseToFamilyLinks.DeleteAt(i);
                }
                else
                {
                    CheckPointerWithNotes(sfl);
                }
            }

            if (iRec.HasAssociations)
            {
                for (int i = 0, num = iRec.Associations.Count; i < num; i++)
                {
                    var asso = iRec.Associations[i];
                    CheckPointerWithNotes(asso);
                    CheckTagWithSourceCitations(asso);
                }
            }

            fBaseContext.ImportNames(iRec);
        }
Пример #2
0
        private static void CheckIndividualRecord(IBaseContext baseContext, GDMTree tree, GEDCOMFormat format,
                                                  GDMIndividualRecord iRec)
        {
            for (int i = 0, num = iRec.Events.Count; i < num; i++)
            {
                GDMCustomEvent evt = iRec.Events[i];

                CheckEvent(tree, format, evt);

                baseContext.CollectEventValues(evt);
            }

            for (int i = 0, num = iRec.UserReferences.Count; i < num; i++)
            {
                CheckUserRef(iRec, iRec.UserReferences[i]);
            }

            for (int i = 0, num = iRec.PersonalNames.Count; i < num; i++)
            {
                CheckPersonalName(baseContext, tree, format, iRec.PersonalNames[i]);
            }

            for (int i = iRec.ChildToFamilyLinks.Count - 1; i >= 0; i--)
            {
                var cfl = iRec.ChildToFamilyLinks[i];
                if (cfl.Family == null)
                {
                    iRec.ChildToFamilyLinks.DeleteAt(i);
                }
                else
                {
                    CheckPointerWithNotes(tree, format, cfl);
                }
            }

            for (int i = iRec.SpouseToFamilyLinks.Count - 1; i >= 0; i--)
            {
                var sfl = iRec.SpouseToFamilyLinks[i];
                if (sfl.Family == null)
                {
                    iRec.SpouseToFamilyLinks.DeleteAt(i);
                }
                else
                {
                    CheckPointerWithNotes(tree, format, sfl);
                }
            }

            for (int i = 0, num = iRec.Associations.Count; i < num; i++)
            {
                var asso = iRec.Associations[i];
                CheckPointerWithNotes(tree, format, asso);
                CheckTagWithSourceCitations(tree, format, asso);
            }

            baseContext.ImportNames(iRec);
        }
Пример #3
0
        private static void CheckIndividualRecord(IBaseContext baseContext, GDMTree tree, GEDCOMFormat format,
                                                  GDMIndividualRecord iRec)
        {
            if (format == GEDCOMFormat.gf_Native)
            {
                for (int i = 0, num = iRec.Events.Count; i < num; i++)
                {
                    GDMCustomEvent evt = iRec.Events[i];

                    CheckEventPlace(evt);
                    CheckAttrCompatible(tree, format, iRec, evt);
                    CheckRecord_RepairTag(tree, format, evt);

                    baseContext.CollectEventValues(evt);
                }

                for (int i = 0, num = iRec.UserReferences.Count; i < num; i++)
                {
                    CheckURefCompatible(iRec, iRec.UserReferences[i]);
                }

                for (int i = 0, num = iRec.PersonalNames.Count; i < num; i++)
                {
                    CheckPersonalName(iRec, iRec.PersonalNames[i], baseContext);
                }
            }
            else
            {
                for (int i = 0, num = iRec.Events.Count; i < num; i++)
                {
                    GDMCustomEvent evt = iRec.Events[i];

                    CheckIndividualEvent(evt, format);
                    CheckTagWithLists(tree, format, evt);
                }

                for (int i = 0, num = iRec.ChildToFamilyLinks.Count; i < num; i++)
                {
                    CheckPointerWithNotes(tree, format, iRec.ChildToFamilyLinks[i]);
                }

                for (int i = 0, num = iRec.SpouseToFamilyLinks.Count; i < num; i++)
                {
                    CheckPointerWithNotes(tree, format, iRec.SpouseToFamilyLinks[i]);
                }

                for (int i = 0, num = iRec.Associations.Count; i < num; i++)
                {
                    CheckPointerWithNotes(tree, format, iRec.Associations[i]);
                }
            }

            for (int i = iRec.ChildToFamilyLinks.Count - 1; i >= 0; i--)
            {
                if (iRec.ChildToFamilyLinks[i].Family == null)
                {
                    iRec.ChildToFamilyLinks.DeleteAt(i);
                }
            }

            for (int i = iRec.SpouseToFamilyLinks.Count - 1; i >= 0; i--)
            {
                if (iRec.SpouseToFamilyLinks[i].Family == null)
                {
                    iRec.SpouseToFamilyLinks.DeleteAt(i);
                }
            }

            baseContext.ImportNames(iRec);
        }