// Copy Constructor
 public CAddressStructure( CAddressStructure ads )
     : base(ads.Gedcom)
 {
     m_sAddressLine = ads.m_sAddressLine;
     m_sAddressLine1 = ads.m_sAddressLine1;
     m_sAddressLine2 = ads.m_sAddressLine2;
     m_sAddressLine3 = ads.m_sAddressLine3;
     m_sAddressCity = ads.m_sAddressCity;
     m_sAddressState = ads.m_sAddressState;
     m_sAddressPostalCode = ads.m_sAddressPostalCode;
     m_sAddressCountry = ads.m_sAddressCountry;
     m_alPhoneNumbers = new ArrayList();
     foreach( string pn in ads.m_alPhoneNumbers )
     {
         m_alPhoneNumbers.Add( pn );
     }
     m_alAddressEmails = new ArrayList();
     foreach( string ae in ads.m_alAddressEmails )
     {
         m_alAddressEmails.Add( ae );
     }
     m_alAddressFaxes = new ArrayList();
     foreach( string af in ads.m_alAddressFaxes )
     {
         m_alAddressFaxes.Add( af );
     }
     m_alAddressWebPages = new ArrayList();
     foreach( string awp in ads.m_alAddressWebPages )
     {
         m_alAddressWebPages.Add( awp );
     }
 }
        // Parser
        public static CAddressStructure Parse( CGedcom gedcom, int nLevel )
        {
            CGedcomLine gedcomLine;
            string sAddressLine;

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

            // Temporary holders for class members. Saves constructing a class early.
            string sAddressLine1 = "";
            string sAddressLine2 = "";
            string sAddressLine3 = "";
            string sAddressCity = "";
            string sAddressState = "";
            string sAddressPostalCode = "";
            string sAddressCountry = "";
            ArrayList alPhoneNumbers = new ArrayList();
            ArrayList alAddressEmails = new ArrayList();
            ArrayList alAddressFaxes = new ArrayList();
            ArrayList alAddressWebPages = new ArrayList();

            bool bParsingFinished;
            do
            {
                bParsingFinished = true;

                if( (gedcomLine = gedcom.GetLine(nLevel+1, "CONT")) != null )
                {
                    sAddressLine += "\n" + gedcomLine.LineItem;
                    gedcom.IncrementLineIndex(1);
                    bParsingFinished = false;
                }
                else if( (gedcomLine = gedcom.GetLine(nLevel+1, "ADR1")) != null )
                {
                    sAddressLine1 = gedcomLine.LineItem;
                    gedcom.IncrementLineIndex(1);
                    bParsingFinished = false;
                }
                else if( (gedcomLine = gedcom.GetLine(nLevel+1, "ADR2")) != null )
                {
                    sAddressLine2 = gedcomLine.LineItem;
                    gedcom.IncrementLineIndex(1);
                    bParsingFinished = false;
                }
                else if( (gedcomLine = gedcom.GetLine(nLevel+1, "ADR3")) != null )
                {
                    sAddressLine3 = gedcomLine.LineItem;
                    gedcom.IncrementLineIndex(1);
                    bParsingFinished = false;
                }
                else if( (gedcomLine = gedcom.GetLine(nLevel+1, "CITY")) != null )
                {
                    sAddressCity = gedcomLine.LineItem;
                    gedcom.IncrementLineIndex(1);
                    bParsingFinished = false;
                }
                else if( (gedcomLine = gedcom.GetLine(nLevel+1, "STAE")) != null )
                {
                    sAddressState = gedcomLine.LineItem;
                    gedcom.IncrementLineIndex(1);
                    bParsingFinished = false;
                }
                else if( (gedcomLine = gedcom.GetLine(nLevel+1, "POST")) != null )
                {
                    sAddressPostalCode = gedcomLine.LineItem;
                    gedcom.IncrementLineIndex(1);
                    bParsingFinished = false;
                }
                else if( (gedcomLine = gedcom.GetLine(nLevel+1, "CTRY")) != null )
                {
                    sAddressCountry = gedcomLine.LineItem;
                    gedcom.IncrementLineIndex(1);
                    bParsingFinished = false;
                }
                else if( (gedcomLine = gedcom.GetLine(nLevel, "PHON")) != null )
                {
                    alPhoneNumbers.Add( gedcomLine.LineItem );
                    gedcom.IncrementLineIndex(1);
                    bParsingFinished = false;
                }
                else if( (gedcomLine = gedcom.GetLine(nLevel, "EMAIL")) != null )
                {
                    alAddressEmails.Add( gedcomLine.LineItem );
                    gedcom.IncrementLineIndex(1);
                    bParsingFinished = false;
                }
                else if( (gedcomLine = gedcom.GetLine(nLevel, "FAX")) != null )
                {
                    alAddressFaxes.Add( gedcomLine.LineItem );
                    gedcom.IncrementLineIndex(1);
                    bParsingFinished = false;
                }
                else if( (gedcomLine = gedcom.GetLine(nLevel, "WWW")) != null )
                {
                    alAddressWebPages.Add( 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.
            CAddressStructure ads = new CAddressStructure( gedcom );
            ads.m_sAddressLine = sAddressLine;
            ads.m_sAddressLine1 = sAddressLine1;
            ads.m_sAddressLine2 = sAddressLine2;
            ads.m_sAddressLine3 = sAddressLine3;
            ads.m_sAddressCity = sAddressCity;
            ads.m_sAddressState = sAddressState;
            ads.m_sAddressPostalCode = sAddressPostalCode;
            ads.m_sAddressCountry = sAddressCountry;
            ads.m_alPhoneNumbers = alPhoneNumbers;
            ads.m_alAddressEmails = alAddressEmails;
            ads.m_alAddressFaxes = alAddressFaxes;
            ads.m_alAddressWebPages = alAddressWebPages;
            return ads;
        }
 // Copy constructor
 public CEventDetail( CEventDetail ed )
     : base(ed.Gedcom)
 {
     m_sEventOrFactClassification = ed.m_sEventOrFactClassification;
     if( ed.m_dateValue != null )
     {
         m_dateValue = new CPGDate( ed.m_dateValue );
     }
     else
     {
         m_dateValue = null;
     }
     if( ed.m_placeStructure != null )
     {
         m_placeStructure = new CPlaceStructure( ed.m_placeStructure );
     }
     else
     {
         m_placeStructure = null;
     }
     if( ed.m_addressStructure != null )
     {
         m_addressStructure = new CAddressStructure( ed.m_addressStructure );
     }
     else
     {
         m_addressStructure = null;
     }
     m_sResponsibleAgency = ed.m_sResponsibleAgency;
     m_sReligiousAffiliation = ed.m_sReligiousAffiliation;
     m_sCauseOfEvent = ed.m_sCauseOfEvent;
     m_sRestrictionNotice = ed.m_sRestrictionNotice;
     m_alNoteStructures = new ArrayList();
     foreach( CNoteStructure ns in ed.m_alNoteStructures )
     {
         m_alNoteStructures.Add( ns.CopyConstructor() );
     }
     m_alSourceCitations = new ArrayList();
     foreach( CSourceCitation sc in ed.m_alSourceCitations )
     {
         m_alSourceCitations.Add( sc.CopyConstructor() );
     }
     m_alMultimediaLinks = new ArrayList();
     foreach( CMultimediaLink ml in ed.m_alMultimediaLinks )
     {
         m_alMultimediaLinks.Add( ml.CopyConstructor() );
     }
     m_sAgeAtEvent = ed.m_sAgeAtEvent;
     m_sHusbandAgeAtEvent = ed.m_sHusbandAgeAtEvent;
     m_sWifeAgeAtEvent = ed.m_sWifeAgeAtEvent;
     m_xrefFam = ed.m_xrefFam;
     m_bAdoptedByHusband = ed.m_bAdoptedByHusband;
     m_bAdoptedByWife = ed.m_bAdoptedByWife;
     m_xrefAdoptedChild = ed.m_xrefAdoptedChild;
     m_sAlternativePlace = ed.m_sAlternativePlace;
 }