Exemple #1
0
 public GedcomInfo(List <Individual> individuals,
                   List <Family> families,
                   List <Image> images,
                   List <Note> notes,
                   GedcomHeader header,
                   List <string> exclusions)
 {
     this.individuals = individuals;
     this.families    = families;
     this.images      = images;
     this.notes       = notes;
     this.header      = header;
     this.exclusions  = exclusions;
 }
        public GedcomInfo Import(Stream stream)
        {
            var          individuals  = new List <Individual>();
            var          families     = new List <Family>();
            var          images       = new List <Image>();
            var          notes        = new List <Note>();
            GedcomHeader gedcomHeader = null;

            GedcomStreamingParser gedcomStreamingParser = new GedcomStreamingParser(
                header => gedcomHeader = header,
                individual => individuals.Add(individual),
                family => families.Add(family),
                image => images.Add(image),
                note => notes.Add(note));

            gedcomStreamingParser.Parse(stream);

            var gedcomInfo = new GedcomInfo(individuals, families, images, notes, gedcomHeader, new List <string>());

            return(gedcomInfo);
        }