Exemplo n.º 1
0
        private static void CheckTagWithLists(GDMTree tree, GEDCOMFormat format, GDMTagWithLists tag)
        {
            int num = tag.MultimediaLinks.Count;

            for (int i = 0; i < num; i++)
            {
                GDMMultimediaLink mmLink = tag.MultimediaLinks[i];
                if (!mmLink.IsPointer)
                {
                    TransformMultimediaLink(tree, mmLink);
                }
            }

            num = tag.Notes.Count;
            for (int i = 0; i < num; i++)
            {
                GDMNotes note = tag.Notes[i];
                if (!note.IsPointer)
                {
                    TransformNote(tree, note);
                }
            }

            num = tag.SourceCitations.Count;
            for (int i = 0; i < num; i++)
            {
                GDMSourceCitation sourCit = tag.SourceCitations[i];
                if (!sourCit.IsPointer)
                {
                    TransformSourceCitation(tree, sourCit);
                }
            }
        }
Exemplo n.º 2
0
        // TODO: refactor
        private static void CheckRecord_RepairTag(GDMTree tree, GEDCOMFormat format, GDMTagWithLists tag)
        {
            for (int i = tag.MultimediaLinks.Count - 1; i >= 0; i--)
            {
                GDMMultimediaLink mmLink = tag.MultimediaLinks[i];
                if (mmLink.IsPointer && mmLink.Value == null)
                {
                    tag.MultimediaLinks.DeleteAt(i);
                }
            }

            for (int i = tag.Notes.Count - 1; i >= 0; i--)
            {
                GDMNotes note = tag.Notes[i];
                if (note.IsPointer && note.Value == null)
                {
                    tag.Notes.DeleteAt(i);
                }
            }

            for (int i = tag.SourceCitations.Count - 1; i >= 0; i--)
            {
                GDMSourceCitation sourCit = tag.SourceCitations[i];
                if (sourCit.IsPointer && sourCit.Value == null)
                {
                    tag.SourceCitations.DeleteAt(i);
                }
            }
        }