コード例 #1
0
        // Parser
        public static CSourceCallNumber Parse( CGedcom gedcom, int nLevel )
        {
            CGedcomLine gedcomLine;

            // Temporary holders for class members. Saves constructing a class early.
            string sSourceCallNumber;
            string sSourceMediaType = "";

            // There must be one of these, it defines the object.
            if ((gedcomLine = gedcom.GetLine(nLevel, "CALN")) == null)
            {
                // Not one of us
                return null;
            }
            gedcom.IncrementLineIndex(1);
            sSourceCallNumber = gedcomLine.LineItem;

            if( (gedcomLine = gedcom.GetLine(nLevel+1, "MEDI")) != null  )
            {
                sSourceMediaType = gedcomLine.LineItem;
                gedcom.IncrementLineIndex(1);
            }
            else if( ( gedcomLine = gedcom.GetLine()).Level > nLevel )
            {
                LogFile.TheLogFile.WriteLine( LogFile.DT_GEDCOM, LogFile.EDebugLevel.Warning, "Unknown tag :" );
                LogFile.TheLogFile.WriteLine( LogFile.DT_GEDCOM, LogFile.EDebugLevel.Warning, gedcomLine.ToString() );
                gedcom.IncrementLineIndex(1);
            }

            // Parsing went ok. Construct a new object and return it.
            CSourceCallNumber scn = new CSourceCallNumber( gedcom );
            scn.m_sSourceCallNumber = sSourceCallNumber;
            scn.m_sSourceMediaType = sSourceMediaType;
            return scn;
        }
コード例 #2
0
 // Constructor
 public CSubmitterRecord( CGedcom gedcom )
     : base(gedcom)
 {
     m_alMultimediaLinks = new ArrayList();
     m_alLanguagePreferences = new ArrayList();
     m_alNoteStructures = new ArrayList();
 }
コード例 #3
0
        // Parser
        public bool ParseRecord( CGedcom gedcom, int level )
        {
            CGedcomLine line;
            CUserReferenceNumber urn;
            CChangeDate cd;
            bool bParsingFinished;
            bool bGotSomething = false;
            do
            {
                bParsingFinished = true;

                if( (line = gedcom.GetLine( level+1, "RIN" )) != null )
                {
                    m_sAutomatedRecordId = line.LineItem;
                    gedcom.IncrementLineIndex(1);
                    bParsingFinished = false;
                    bGotSomething = true;
                }
                else if( (urn = CUserReferenceNumber.Parse( gedcom, level+1 )) != null )
                {
                    m_alUserReferenceNumbers.Add( urn );
                    bParsingFinished = false;
                    bGotSomething = true;
                }
                else if( (cd = CChangeDate.Parse( gedcom, level+1 )) != null )
                {
                    m_changeDate = cd;
                    bParsingFinished = false;
                    bGotSomething = true;
                }
            }
            while( !bParsingFinished );

            return bGotSomething;
        }
コード例 #4
0
        // Parser
        public static CRepositoryRecord Parse( CGedcom gedcom, int nLevel )
        {
            CGedcomLine gedcomLine;
            bool bParsingFinished;

            // Temporary holders for class members.
            CNoteStructure ns;
            CAddressStructure ads;

            // Without an xref header, we can't continue
            if ((gedcomLine = gedcom.GetLine(nLevel, "REPO")) == null)
            {
                // Not one of us
                return null;
            }

            CRepositoryRecord rr = new CRepositoryRecord( gedcom );

            rr.m_xref = gedcomLine.XrefID;
            gedcom.IncrementLineIndex(1);

            do
            {
                bParsingFinished = true;

                // Let Record have a go at parsing the rest
                if( rr.ParseRecord( gedcom, nLevel ) )
                {
                    bParsingFinished = false;
                    continue;
                }
                else if( (gedcomLine = gedcom.GetLine(nLevel+1, "NAME")) != null )
                {
                    rr.m_sNameOfRepository = gedcomLine.LineItem;
                    gedcom.IncrementLineIndex(1);
                    bParsingFinished = false;
                }
                else if( (ads = CAddressStructure.Parse( gedcom, nLevel+1)) != null )
                {
                    rr.m_addressStructure = ads;
                    bParsingFinished = false;
                }
                else if( (ns = CNoteStructure.Parse( gedcom, nLevel+1 )) != null )
                {
                    rr.m_alNoteStructures.Add( ns );
                    bParsingFinished = false;
                }
                else if( ( gedcomLine = gedcom.GetLine()).Level > nLevel )
                {
                    LogFile.TheLogFile.WriteLine( LogFile.DT_GEDCOM, LogFile.EDebugLevel.Warning, "Unknown tag :" );
                    LogFile.TheLogFile.WriteLine( LogFile.DT_GEDCOM, LogFile.EDebugLevel.Warning, gedcomLine.ToString() );
                    gedcom.IncrementLineIndex(1);
                    bParsingFinished = false;
                }
            }
            while( !bParsingFinished );

            return rr;
        }
コード例 #5
0
 // Constructor
 public CMultimediaRecord( CGedcom gedcom )
     : base(gedcom)
 {
     m_alMultimediaFileReferences = new ArrayList();
     m_alNoteStructures = new ArrayList();
     m_alSourceCitations = new ArrayList();
     m_htAsidPairs = new Hashtable();
 }
コード例 #6
0
 // Constructor
 public CISRecord( CGedcom gedcom )
     : base(gedcom)
 {
     m_alNoteStructures = new ArrayList();
     m_alMultimediaLinks = new ArrayList();
     m_bRestricted = false;
     m_alUniqueFileRefs = new ArrayList();
 }
コード例 #7
0
 // Constructor
 public CSourceRecord( CGedcom gedcom )
     : base(gedcom)
 {
     m_alEventsRecorded = new ArrayList();
     m_alSourceRepositoryCitations = new ArrayList();
     m_alDataNoteStructures = new ArrayList();
     m_bRequiredInHTML = false;
     m_alBackreferences = new ArrayList();
 }
コード例 #8
0
 // Constructor
 public CMultimediaFileReference( CGedcom gedcom )
     : base(gedcom)
 {
     m_bFromGEDCOM = true;
     m_bVisible = true;
     m_nOrderIndex = 0;
     m_mfrOriginal = null;
     m_asidPair = null;
     m_xrefEmbedded = "";
     m_sMultimediaFileReference = "";
 }
コード例 #9
0
 // Constructor
 public CFamilyRecord( CGedcom gedcom )
     : base(gedcom)
 {
     m_alFamilyEventStructures = new ArrayList();
     m_alXrefsChildren = new ArrayList();
     m_alXrefSubms = new ArrayList();
     m_alLdsSpouseSealings = new ArrayList();
     m_alNoteStructures = new ArrayList();
     m_alSourceCitations = new ArrayList();
     m_alMultimediaLinks = new ArrayList();
 }
コード例 #10
0
 // Constructor
 public CPersonalNamePieces( CGedcom gedcom )
     : base(gedcom)
 {
     m_sNamePiecePrefix = "";
     m_sNamePieceGiven = "";
     m_sNamePieceNickname = "";
     m_sNamePieceSurnamePrefix = "";
     m_sNamePieceSurname = "";
     m_sNamePieceSuffix = "";
     m_alNoteStructures = new ArrayList();
     m_alSourceCitations = new ArrayList();
 }
コード例 #11
0
        // Parser
        public static CSourceRepositoryCitation Parse( CGedcom gedcom, int nLevel )
        {
            CGedcomLine gedcomLine;

            // Temporary holders for class members. Saves constructing a class early.
            string xrefRepo;
            ArrayList alSourceCallNumbers = new ArrayList();
            CSourceCallNumber sourceCallNumber = null;
            ArrayList alNoteStructures = new ArrayList();
            CNoteStructure noteStructure = null;

            // There must be one of these, it defines the object.
            if ((gedcomLine = gedcom.GetLine(nLevel, "REPO")) == null)
            {
                // Not one of us
                return null;
            }
            xrefRepo = gedcomLine.LinePointer;
            gedcom.IncrementLineIndex(1);

            bool bParsingFinished;
            do
            {
                bParsingFinished = true;

                if( (noteStructure = CNoteStructure.Parse( gedcom, nLevel+1 )) != null )
                {
                    alNoteStructures.Add( noteStructure );
                    bParsingFinished = false;
                }
                else if( (sourceCallNumber = CSourceCallNumber.Parse( gedcom, nLevel+1 )) != null )
                {
                    alSourceCallNumbers.Add( sourceCallNumber );
                    bParsingFinished = false;
                }
                else if( ( gedcomLine = gedcom.GetLine()).Level > nLevel )
                {
                    LogFile.TheLogFile.WriteLine( LogFile.DT_GEDCOM, LogFile.EDebugLevel.Warning, "Unknown tag :" );
                    LogFile.TheLogFile.WriteLine( LogFile.DT_GEDCOM, LogFile.EDebugLevel.Warning, gedcomLine.ToString() );
                    gedcom.IncrementLineIndex(1);
                    bParsingFinished = false;
                }
            }
            while( !bParsingFinished );

            // Parsing went ok. Construct a new object and return it.
            CSourceRepositoryCitation src = new CSourceRepositoryCitation( gedcom );
            src.m_xrefRepo = xrefRepo;
            src.m_alSourceCallNumbers = alSourceCallNumbers;
            src.m_alNoteStructures = alNoteStructures;
            return src;
        }
コード例 #12
0
        // Parser
        public static CEventRecorded Parse( CGedcom gedcom, int nLevel )
        {
            CGedcomLine gedcomLine;

            // Temporary holders for class members. Saves constructing a class early.
            string eventRecorded;
            string datePeriod = "";
            string sourceJurisdictionPlace = "";

            // There must be one of these, it defines the object.
            if ((gedcomLine = gedcom.GetLine(nLevel, "EVEN")) == null)
            {
                // Not one of us
                return null;
            }
            gedcom.IncrementLineIndex(1);
            eventRecorded = gedcomLine.LineItem;

            bool bParsingFinished;
            do
            {
                bParsingFinished = true;

                if( (gedcomLine = gedcom.GetLine(nLevel+1, "DATE")) != null  )
                {
                    datePeriod = gedcomLine.LineItem;
                    gedcom.IncrementLineIndex(1);
                    bParsingFinished = false;
                }
                else if( (gedcomLine = gedcom.GetLine(nLevel+1, "PLAC")) != null  )
                {
                    sourceJurisdictionPlace = gedcomLine.LineItem;
                    gedcom.IncrementLineIndex(1);
                    bParsingFinished = false;
                }
                else if( ( gedcomLine = gedcom.GetLine()).Level > nLevel )
                {
                    LogFile.TheLogFile.WriteLine( LogFile.DT_GEDCOM, LogFile.EDebugLevel.Warning, "Unknown tag :" );
                    LogFile.TheLogFile.WriteLine( LogFile.DT_GEDCOM, LogFile.EDebugLevel.Warning, gedcomLine.ToString() );
                    gedcom.IncrementLineIndex(1);
                    bParsingFinished = false;
                }
            }
            while( !bParsingFinished );

            // Parsing went ok. Construct a new object and return it.
            CEventRecorded er = new CEventRecorded( gedcom );
            er.m_sEventRecorded = eventRecorded;
            er.m_sDatePeriod = datePeriod;
            er.m_sSourceJurisdictionPlace = sourceJurisdictionPlace;
            return er;
        }
コード例 #13
0
        public static CNameRomanizedVariation Parse( CGedcom gedcom, int nLevel )
        {
            CGedcomLine gedcomLIne;

            // Temporary holders for class members. Saves constructing a class early.
            string sNameRomanizedVariation;
            string sRomanizedType = "";
            CPersonalNamePieces pnp, personalNamePieces=null;

            // There must be one of these, it defines the object.
            if ((gedcomLIne = gedcom.GetLine(nLevel, "ROMN")) == null)
            {
                // Not one of us
                return null;
            }
            sNameRomanizedVariation = gedcomLIne.LineItem;
            gedcom.IncrementLineIndex(1);

            bool bParsingFinished;
            do
            {
                bParsingFinished = true;

                if( (gedcomLIne = gedcom.GetLine(nLevel+1, "TYPE")) != null )
                {
                    sRomanizedType = gedcomLIne.LineItem;
                    gedcom.IncrementLineIndex(1);
                    bParsingFinished = false;
                }
                else if( (pnp = CPersonalNamePieces.Parse( gedcom, nLevel+1 )) != null )
                {
                    personalNamePieces = pnp;
                    bParsingFinished = false;
                }
                else if( ( gedcomLIne = gedcom.GetLine()).Level > nLevel )
                {
                    LogFile.TheLogFile.WriteLine( LogFile.DT_GEDCOM, LogFile.EDebugLevel.Warning, "Unknown tag :" );
                    LogFile.TheLogFile.WriteLine( LogFile.DT_GEDCOM, LogFile.EDebugLevel.Warning, gedcomLIne.ToString() );
                    gedcom.IncrementLineIndex(1);
                    bParsingFinished = false;
                }
            }
            while( !bParsingFinished );

            // Parsing went ok. Construct a new object and return it.
            CNameRomanizedVariation nrv = new CNameRomanizedVariation( gedcom );
            nrv.m_sNameRomanizedVariation = sNameRomanizedVariation;
            nrv.m_sRomanizedType = sRomanizedType;
            nrv.m_personalNamePieces = personalNamePieces;
            return nrv;
        }
コード例 #14
0
 // Constructor
 public CIndividualRecord( CGedcom gedcom )
     : base(gedcom)
 {
     m_alPersonalNameStructures = new ArrayList();
     m_alIndividualEventStructures = new ArrayList();
     m_alLdsIndividualOrdinances = new ArrayList();
     m_alChildToFamilyLinks = new ArrayList();
     m_alSpouseToFamilyLinks = new ArrayList();
     m_alXrefSubms = new ArrayList();
     m_alAssociationStructures = new ArrayList();
     m_alXrefAlias = new ArrayList();
     m_alXrefAncis = new ArrayList();
     m_alXrefDesis = new ArrayList();
     m_alSourceCitations = new ArrayList();
 }
コード例 #15
0
        // Parser
        public static CSpouseToFamilyLink Parse( CGedcom gedcom, int nLevel )
        {
            CGedcomLine gedcomLine;

            // Temporary holders for class members. Saves constructing a class early.
            string xrefFam;
            CNoteStructure noteStructure;
            ArrayList noteStructures = new ArrayList();

            // There must be one of these, it defines the object.
            if ((gedcomLine = gedcom.GetLine(nLevel, "FAMS")) == null)
            {
                // Not one of us
                return null;
            }
            xrefFam = gedcomLine.LinePointer;

            // Parsing is going well enough to say that we definitely have one of these,
            // so we can adjust the gedcom now.
            gedcom.IncrementLineIndex(1);

            bool bParsingFinished;
            do
            {
                bParsingFinished = true;

                if( (noteStructure = CNoteStructure.Parse( gedcom, nLevel+1 )) != null )
                {
                    noteStructures.Add( noteStructure );
                    bParsingFinished = false;
                }
                else if( ( gedcomLine = gedcom.GetLine()).Level > nLevel )
                {
                    LogFile.TheLogFile.WriteLine( LogFile.DT_GEDCOM, LogFile.EDebugLevel.Warning, "Unknown tag :" );
                    LogFile.TheLogFile.WriteLine( LogFile.DT_GEDCOM, LogFile.EDebugLevel.Warning, gedcomLine.ToString() );
                    gedcom.IncrementLineIndex(1);
                    bParsingFinished = false;
                }

            }
            while( !bParsingFinished );

            // Parsing went ok. Construct a new object and return it.
            CSpouseToFamilyLink sfl = new CSpouseToFamilyLink( gedcom );
            sfl.m_xrefFam = xrefFam;
            sfl.m_alNoteStructures = noteStructures;
            return sfl;
        }
コード例 #16
0
        // Parser
        public static new CNoteStructureXref Parse( CGedcom gedcom, int nLevel )
        {
            CGedcomLine gedcomLine;

            // Temporary holders for class members. Saves constructing a class early.
            string xref;
            ArrayList sourceCitations = new ArrayList();
            CSourceCitation sourceCitation;

            // There must be one of these, it defines the object.
            if ((gedcomLine = gedcom.GetLine(nLevel, "NOTE")) == null)
            {
                // Not one of us
                return null;
            }

            xref = gedcomLine.LinePointer;

            // Parsing is going well enough to say that we definitely have one of these,
            // so we can adjust the gedcom now.
            gedcom.IncrementLineIndex(1);

            bool bParsingFinished;
            do
            {
                bParsingFinished = true;

                if( (sourceCitation = CSourceCitation.Parse( gedcom, nLevel+1 )) != null )
                {
                    sourceCitations.Add( sourceCitation );
                    bParsingFinished = false;
                }
                else if( ( gedcomLine = gedcom.GetLine()).Level > nLevel )
                {
                    LogFile.TheLogFile.WriteLine( LogFile.DT_GEDCOM, LogFile.EDebugLevel.Warning, "Unknown tag :" );
                    LogFile.TheLogFile.WriteLine( LogFile.DT_GEDCOM, LogFile.EDebugLevel.Warning, gedcomLine.ToString() );
                    gedcom.IncrementLineIndex(1);
                    bParsingFinished = false;
                }
            }
            while( !bParsingFinished );

            // Parsing went ok. Construct a new object and return it.
            CNoteStructureXref ns = new CNoteStructureXref( gedcom );
            ns.m_xref = xref;
            ns.m_alSourceCitations = sourceCitations;
            return ns;
        }
コード例 #17
0
        // Parser
        public static CNoteStructure Parse( CGedcom gedcom, int level )
        {
            CGedcomLine line;

            // There must be one of these, it defines the object.
            if ((line = gedcom.GetLine(level, "NOTE")) == null)
            {
                return null; // Not one of us
            }

            // If bit after tag contains a pointer, it must be a reference sType of note
            if( line.LinePointer != null ) //TODO
            {
                return CNoteStructureXref.Parse( gedcom, level );
            }

            // Must be the inline version
            return CNoteStructureInLine.Parse( gedcom, level );
        }
コード例 #18
0
        // Parser
        public static CSourceCitation Parse( CGedcom gedcom, int nLevel )
        {
            CGedcomLine gedcomLine;

            // There must be one of these, it defines the object.
            if ((gedcomLine = gedcom.GetLine(nLevel, "SOUR")) == null)
            {
                // Not one of us
                return null;
            }

            // If bit after tag contains a pointer, it must be a reference sType of note
            if( gedcomLine.LinePointer != null ) //TODO
            {
                return CSourceCitationXref.Parse( gedcom, nLevel );
            }

            // Must be the inline version
            return CSourceCitationInLine.Parse( gedcom, nLevel );
        }
コード例 #19
0
        // Parser
        public static CUserReferenceNumber Parse( CGedcom gedcom, int nLevel )
        {
            CGedcomLine gedcomLine;

            // Temporary holders for class members. Saves constructing a class early.
            string sUserReferenceNumber = "";
            string sUserReferenceType = "";

            // There must be one of these, it defines the object.
            if ((gedcomLine = gedcom.GetLine(nLevel, "REFN")) == null)
            {
                // Not one of us
                return null;
            }
            sUserReferenceNumber = gedcomLine.LineItem;

            // Parsing is going well enough to say that we definitely have one of these,
            // so we can adjust the gedcom now.
            gedcom.IncrementLineIndex(1);

            // There may be one of these, standard specifies {0:1}
            if( (gedcomLine = gedcom.GetLine(nLevel+1, "TYPE")) != null )
            {
                sUserReferenceType = gedcomLine.LineItem;
                gedcom.IncrementLineIndex(1);
            }
            else if( ( gedcomLine = gedcom.GetLine()).Level > nLevel )
            {
                LogFile.TheLogFile.WriteLine( LogFile.DT_GEDCOM, LogFile.EDebugLevel.Warning, "Unknown tag :" );
                LogFile.TheLogFile.WriteLine( LogFile.DT_GEDCOM, LogFile.EDebugLevel.Warning, gedcomLine.ToString() );
                gedcom.IncrementLineIndex(1);
            }

            // Parsing went ok. Construct a new object and return it.
            CUserReferenceNumber urn = new CUserReferenceNumber( gedcom );
            urn.m_sUserReferenceNumber = sUserReferenceNumber;
            urn.m_sUserReferenceType = sUserReferenceType;
            return urn;
        }
コード例 #20
0
        // Parser
        public static new CMultimediaLinkXref Parse( CGedcom gedcom, int level )
        {
            CGedcomLine line;

            // Temporary holders for class members. Saves constructing a class early.
            string xref;
            string asid = "";

            // There must be one of these, it defines the object.
            if ((line = gedcom.GetLine(level, "OBJE")) == null)
            {
                // Not one of us
                return null;
            }
            xref = line.LinePointer;

            // Parsing is going well enough to say that we definitely have one of these,
            // so we can adjust the gedcom now.
            gedcom.IncrementLineIndex(1);

            if( (line = gedcom.GetLine(level+1, "_ASID")) != null )
            {
                asid = line.LineItem;
                gedcom.IncrementLineIndex(1);
            }
            else if( ( line = gedcom.GetLine()).Level > level )
            {
                LogFile.TheLogFile.WriteLine( LogFile.DT_GEDCOM, LogFile.EDebugLevel.Warning, "Unknown tag :" );
                LogFile.TheLogFile.WriteLine( LogFile.DT_GEDCOM, LogFile.EDebugLevel.Warning, line.ToString() );
                gedcom.IncrementLineIndex(1);
            }

            // Parsing went ok. Construct a new object and return it.
            CMultimediaLinkXref ml = new CMultimediaLinkXref( gedcom );
            ml.m_xref = xref;
            ml.m_sAsid = asid;
            return ml;
        }
コード例 #21
0
        // Parser
        public static CChildToFamilyLink Parse( CGedcom gedcom, int nLevel )
        {
            CGedcomLine gedcomLine;

            // Temporary holders for class members. Saves constructing a class early.
            string xrefFam;
            string sPedigreeLinkageType = "";
            string sChildLinkageStatus = "";
            CNoteStructure noteStructure;
            ArrayList alNoteStructures = new ArrayList();

            // There must be one of these, it defines the object.
            if ((gedcomLine = gedcom.GetLine(nLevel, "FAMC")) == null)
            {
                // Not one of us
                return null;
            }
            xrefFam = gedcomLine.LinePointer;

            // Parsing is going well enough to say that we definitely have one of these,
            // so we can adjust the gedcom now.
            gedcom.IncrementLineIndex(1);

            bool bParsingFinished;
            do
            {
                bParsingFinished = true;

                // There may be one of these, standard specifies {0:1}
                if( (gedcomLine = gedcom.GetLine(nLevel+1, "PEDI")) != null )
                {
                    sPedigreeLinkageType = gedcomLine.LineItem;
                    gedcom.IncrementLineIndex(1);
                    bParsingFinished = false;
                }
                else if( (gedcomLine = gedcom.GetLine(nLevel+1, "STAT")) != null )
                {
                    sChildLinkageStatus = gedcomLine.LineItem;
                    gedcom.IncrementLineIndex(1);
                    bParsingFinished = false;
                }
                else if( (noteStructure = CNoteStructure.Parse( gedcom, nLevel+1 )) != null )
                {
                    alNoteStructures.Add( noteStructure );
                    bParsingFinished = false;
                }
                else if( ( gedcomLine = gedcom.GetLine()).Level > nLevel )
                {
                    LogFile.TheLogFile.WriteLine( LogFile.DT_GEDCOM, LogFile.EDebugLevel.Warning, "Unknown tag :" );
                    LogFile.TheLogFile.WriteLine( LogFile.DT_GEDCOM, LogFile.EDebugLevel.Warning, gedcomLine.ToString() );
                    gedcom.IncrementLineIndex(1);
                    bParsingFinished = false;
                }
            }
            while( !bParsingFinished );

            // Parsing went ok. Construct a new object and return it.
            CChildToFamilyLink cfl = new CChildToFamilyLink( gedcom );
            cfl.m_xrefFam = xrefFam;
            cfl.m_sPedigreeLinkageType = sPedigreeLinkageType;
            cfl.m_sChildLinkageStatus = sChildLinkageStatus;
            cfl.m_alNoteStructures = alNoteStructures;
            return cfl;
        }
コード例 #22
0
 // Constructor
 public CChildToFamilyLink( CGedcom gedcom )
     : base(gedcom)
 {
 }
コード例 #23
0
        // Parser
        public static CAssociationStructure Parse( CGedcom gedcom, int nLevel )
        {
            CGedcomLine gedcomLine;

            // Temporary holders for class members. Saves constructing a class early.
            string xrefIndi;
            string sRelationIsDescriptor = "";
            CSourceCitation sourceCitation;
            ArrayList alSourceCitations = new ArrayList();
            CNoteStructure noteStructure;
            ArrayList alNoteStructures = new ArrayList();
            string sRecordType = "";

            // There must be one of these, it defines the object.
            if ((gedcomLine = gedcom.GetLine(nLevel, "ASSO")) == null)
            {
                // Not one of us
                return null;
            }
            xrefIndi = gedcomLine.LinePointer;

            // Parsing is going well enough to say that we definitely have one of these,
            // so we can adjust the gedcom now.
            gedcom.IncrementLineIndex(1);

            bool bParsingFinished;
            do
            {
                bParsingFinished = true;

                // There may be one of these, standard specifies {0:1}
                if( (gedcomLine = gedcom.GetLine(nLevel+1, "RELA")) != null )
                {
                    sRelationIsDescriptor = gedcomLine.LineItem;
                    gedcom.IncrementLineIndex(1);
                    bParsingFinished = false;
                }
                else if( (sourceCitation = CSourceCitation.Parse( gedcom, nLevel+1 )) != null )
                {
                    alSourceCitations.Add( sourceCitation );
                    bParsingFinished = false;
                }
                else if( (noteStructure = CNoteStructure.Parse( gedcom, nLevel+1 )) != null )
                {
                    alNoteStructures.Add( noteStructure );
                    bParsingFinished = false;
                }
                else if( (gedcomLine = gedcom.GetLine(nLevel+1, "TYPE")) != null )
                {
                    sRecordType = gedcomLine.LineItem;
                    gedcom.IncrementLineIndex(1);
                    bParsingFinished = false;
                }
                else if( ( gedcomLine = gedcom.GetLine()).Level > nLevel )
                {
                    LogFile.TheLogFile.WriteLine( LogFile.DT_GEDCOM, LogFile.EDebugLevel.Warning, "Unknown tag :" );
                    LogFile.TheLogFile.WriteLine( LogFile.DT_GEDCOM, LogFile.EDebugLevel.Warning, gedcomLine.ToString() );
                    gedcom.IncrementLineIndex(1);
                    bParsingFinished = false;
                }
            }
            while( !bParsingFinished );

            // Parsing went ok. Construct a new object and return it.
            CAssociationStructure ass = new CAssociationStructure( gedcom );
            ass.m_xrefIndi = xrefIndi;
            ass.m_sRelationIsDescriptor = sRelationIsDescriptor;
            ass.m_alSourceCitations = alSourceCitations;
            ass.m_alNoteStructures = alNoteStructures;
            ass.m_sRecordType = sRecordType;
            return ass;
        }
コード例 #24
0
 // Constructor
 public CAssociationStructure( CGedcom gedcom )
     : base(gedcom)
 {
 }
コード例 #25
0
 // Constructor
 public CEventRecorded( CGedcom gedcom )
     : base(gedcom)
 {
 }
コード例 #26
0
 // Constructor
 public CLdsOrdinance( CGedcom gedcom )
     : base(gedcom)
 {
 }
コード例 #27
0
 // Constructor
 public CTreeDrawer(CGedcom gedcom)
 {
     m_gedcom = gedcom;
 }
コード例 #28
0
 public CCreatorStylesheet( CGedcom gedcom, IProgressCallback progress, string sW3cfile, string sCssFilename, string sBackgroundImageFilename )
     : base(gedcom, progress, sW3cfile)
 {
     m_sCssFilename = sCssFilename;
       m_sBackgroundImageFilename = sBackgroundImageFilename;
 }
コード例 #29
0
 // Constructor
 public CCreatorRecordSource( CGedcom gedcom, IProgressCallback progress, string w3cfile, CSourceRecord sr )
     : base(gedcom, progress, w3cfile)
 {
     m_sr = sr;
 }
コード例 #30
0
        // Parser
        public static CLdsOrdinance Parse( CGedcom gedcom, int level )
        {
            CGedcomLine gedcomLine;

            // Temporary holders for class members. Saves constructing a class early.
            string sType;
            string sDateLdsOrd = "";
            string sTempleCode = "";
            string sPlaceLivingOrdinance = "";
            string xrefFam = "";
            string sLdsDateStatus = "";
            string sChangeDate = "";
            ArrayList noteStructures = new ArrayList();
            ArrayList sourceCitations = new ArrayList();

            CSourceCitation sourceCitation;
            CNoteStructure noteStructure;

            // There must be one of these, it defines the object.
            if ((gedcomLine = gedcom.GetLine(level, "BAPL")) == null
              || (gedcomLine = gedcom.GetLine(level, "ENDL")) == null
              || (gedcomLine = gedcom.GetLine(level, "SLGC")) == null
              || (gedcomLine = gedcom.GetLine(level, "CONL")) == null
              || (gedcomLine = gedcom.GetLine(level, "SLGS")) == null)
            {
                // Not one of us
                return null;
            }

            sType = gedcomLine.Tag;
            gedcom.IncrementLineIndex(1);

            bool bParsingFinished;
            do
            {
                bParsingFinished = true;

                if( (gedcomLine = gedcom.GetLine(level+1, "DATE")) != null )
                {
                    sDateLdsOrd = gedcomLine.LineItem;
                    gedcom.IncrementLineIndex(1);
                    bParsingFinished = false;
                }
                else if( (gedcomLine = gedcom.GetLine(level+1, "TEMP")) != null )
                {
                    sTempleCode = gedcomLine.LineItem;
                    gedcom.IncrementLineIndex(1);
                    bParsingFinished = false;
                }
                else if( (gedcomLine = gedcom.GetLine(level+1, "PLAC")) != null )
                {
                    sPlaceLivingOrdinance = gedcomLine.LineItem;
                    gedcom.IncrementLineIndex(1);
                    bParsingFinished = false;
                }
                else if( (gedcomLine = gedcom.GetLine(level+1, "FAMC")) != null )
                {
                    xrefFam = gedcomLine.LinePointer;
                    gedcom.IncrementLineIndex(1);
                    bParsingFinished = false;
                }
                else if( (gedcomLine = gedcom.GetLine(level+1, "STAT")) != null )
                {
                    sLdsDateStatus = gedcomLine.LineItem;
                    gedcom.IncrementLineIndex(1);
                    if( (gedcomLine = gedcom.GetLine(level+2, "DATE")) != null )
                    {
                        sChangeDate = gedcomLine.LineItem;
                        gedcom.IncrementLineIndex(1);
                    }
                    bParsingFinished = false;
                }
                else if( (sourceCitation = CSourceCitation.Parse( gedcom, level+1 )) != null )
                {
                    sourceCitations.Add( sourceCitation );
                    bParsingFinished = false;
                }
                else if( (noteStructure = CNoteStructure.Parse( gedcom, level+1 )) != null )
                {
                    noteStructures.Add( noteStructure );
                    bParsingFinished = false;
                }
                else if( ( gedcomLine = gedcom.GetLine()).Level > level )
                {
                    LogFile.TheLogFile.WriteLine( LogFile.DT_GEDCOM, LogFile.EDebugLevel.Warning, "Unknown tag :" );
                    LogFile.TheLogFile.WriteLine( LogFile.DT_GEDCOM, LogFile.EDebugLevel.Warning, gedcomLine.ToString() );
                    gedcom.IncrementLineIndex(1);
                    bParsingFinished = false;
                }
            }
            while( !bParsingFinished );

            // Parsing went ok. Construct a new object and return it.
            CLdsOrdinance lss = new CLdsOrdinance( gedcom );
            lss.Type = sType;
            lss.m_sDateLdsOrd = sDateLdsOrd;
            lss.m_sTempleCode = sTempleCode;
            lss.m_sPlaceLivingOrdinance = sPlaceLivingOrdinance;
            lss.m_xrefFam = xrefFam;
            lss.m_sLdsDateStatus = sLdsDateStatus;
            lss.m_sChangeDate = sChangeDate;
            lss.m_alNoteStructures = noteStructures;
            lss.m_alSourceCitations = sourceCitations;
            return lss;
        }