コード例 #1
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;
        }
コード例 #2
0
 // Copy constructor
 public override CNoteStructure CopyConstructor()
 {
     CNoteStructureXref ns = new CNoteStructureXref( Gedcom );
     ns.m_xref = m_xref;
     return ns;
 }