/// <summary>
        ///   ReadLine - reads the next GEDCOM record from the buffer
        /// </summary>
        /// <returns>A GEDCOM Record</returns>
        public GEDCOMRecord ReadRecord()
        {
            //Declare Variable
            GEDCOMRecord record = null;

            if (_nextRecord != null)
            {
                record = _nextRecord;

                //Load the next record into the buffer
                GetNextRecord();

                while (_nextRecord != null)
                {
                    if (_nextRecord.Level == record.Level + 1)
                    {
                        switch (_nextRecord.TagName)
                        {
                        // Concatenate.
                        case GEDCOMTag.CONC:
                            record.AppendData(_nextRecord.Data);
                            GetNextRecord();
                            break;

                        // Continue, add record return and then the text.
                        case GEDCOMTag.CONT:
                            record.AppendData("\n" + _nextRecord.Data);
                            GetNextRecord();
                            break;

                        //Add child lines
                        default:
                            GEDCOMRecord childLine = ReadRecord();
                            if (childLine != null)
                            {
                                record.ChildRecords.Add(childLine);
                            }
                            break;
                        }
                    }
                    else
                    {
                        break;
                    }
                }
            }

            if (record == null)
            {
                return(null);
            }

            //Pass to RecordFactory to convert the record into the relevant subclass
            return(GEDCOMRecordFactory.Create(record));
        }
 /// <summary>
 ///   ReadSubmitter - reads the next GEDCOM Submitter (SUBM)
 /// </summary>
 /// <returns>A GEDCOM Submitter</returns>
 public GEDCOMSubmitterRecord ReadSubmitter()
 {
     return(GEDCOMRecordFactory.CreateSubmitterRecord(ReadRecord(GEDCOMTag.SUBM)));
 }
 /// <summary>
 ///   ReadSubmission - reads the next GEDCOM Submission (SUBN)
 /// </summary>
 /// <returns>A GEDCOM Submitter</returns>
 public GEDCOMSubmissionRecord ReadSubmission()
 {
     return(GEDCOMRecordFactory.CreateSubmissionRecord(ReadRecord(GEDCOMTag.SUBN)));
 }
 /// <summary>
 ///   ReadSource - reads the next GEDCOM Source (SOUR)
 /// </summary>
 /// <returns>A GEDCOM Source</returns>
 public GEDCOMSourceRecord ReadSource()
 {
     return(GEDCOMRecordFactory.CreateSourceRecord(ReadRecord(GEDCOMTag.SOUR)));
 }
 /// <summary>
 ///   ReadRepositoy - reads the next GEDCOM Repositoy (REPO)
 /// </summary>
 /// <returns>A GEDCOM Repository</returns>
 public GEDCOMRepositoryRecord ReadRepository()
 {
     return(GEDCOMRecordFactory.CreateRepositoryRecord(ReadRecord(GEDCOMTag.REPO)));
 }
 /// <summary>
 ///   ReadNote - reads the next GEDCOM Note (NOTE)
 /// </summary>
 /// <returns>A GEDCOM Note</returns>
 public GEDCOMNoteRecord ReadNote()
 {
     return(GEDCOMRecordFactory.CreateNoteRecord(ReadRecord(GEDCOMTag.NOTE)));
 }
 /// <summary>
 ///   ReadMultimediaObject - reads the next GEDCOM Multimedia Object (OBJE)
 /// </summary>
 /// <returns>A GEDCOM MultimediaObject</returns>
 public GEDCOMMultimediaRecord ReadMultimediaObject()
 {
     return(GEDCOMRecordFactory.CreateMultimediaRecord(ReadRecord(GEDCOMTag.OBJE)));
 }