// Returns true if the individual record should be added to the tree
 private static bool Exists( CIndividualRecord ir )
 {
     return (ir != null && ir.Visibility() != CIndividualRecord.EVisibility.eV_Invisible);
 }
            public CBoxText(CIndividualRecord ir)
            {
                m_sFirstName = "";
                m_sSurname = "";
                m_bConcealed = (ir.Visibility() == CIndividualRecord.EVisibility.eV_Restricted);
                if (m_bConcealed && !MainForm.s_config.m_bUseWithheldNames)
                {
                    m_sFirstName = "";
                    m_sSurname = m_sName = MainForm.s_config.m_sConcealedName;
                }
                else
                {
                    if (ir.Name != "")
                    {
                        m_sName = MainForm.s_config.CapitaliseName(ir.Name, ref m_sFirstName, ref m_sSurname);
                    }
                    else
                    {
                        m_sFirstName = "";
                        m_sSurname = m_sName = MainForm.s_config.m_sUnknownName;
                    }
                }

                if (m_bConcealed)
                {
                    m_sDate = "";
                }
                else
                {
                    m_sDate = ir.LifeYears;
                }
            }
Esempio n. 3
0
        // Creates link HTML for the individual e.g. <a href="indiI1.html">Next Child</a>. Uses name provided by caller.
        protected static string MakeLink( CIndividualRecord ir, string sName )
        {
            string sLink;
              if( ir.Visibility() == CIndividualRecord.EVisibility.Invisible )
              {
            // TODO: Why are we linking to invisible people?
            sLink = CCreator.EscapeHTML(sName, true);
              }
              else
              {
            sLink = String.Concat("<a href=\"", GetIndividualHTMLFilename(ir), "\">", CCreator.EscapeHTML(sName, false), "</a>");
              }

              return sLink;
        }
Esempio n. 4
0
        // Creates link HTML for the individual e.g. <a href="indiI1.html">Fred Bloggs</a>
        protected static string MakeLink( CIndividualRecord ir )
        {
            string sName = ir.Name;
              string sDummy = "";
              if (sName == "")
              {
              sName = MainForm.s_config.m_sUnknownName;
              }
              else if ((ir.Visibility() != CIndividualRecord.EVisibility.Visible) && !MainForm.s_config.m_bUseWithheldNames)
              {
              sName = MainForm.s_config.m_sConcealedName;
              }
              else
              {
              sName = MainForm.s_config.CapitaliseName(sName, ref sDummy, ref sDummy);
              }

              return MakeLink( ir, sName );
        }
        // Extracts the data from the DEAT event for the given individual and adds it if it was an event in the current individual's lifetime.
        private string AddSpouseDeath( CIndividualRecord spouse, string spouseLink )
        {
            string sourceRefs = "";
              string place = "";
              if (spouse.Visibility() == CIndividualRecord.EVisibility.Visible)
              {
            // Record death of irSubject if within this person's lifetime
            CPGDate spouseDeathDate = null;
            foreach (CIndividualEventStructure ies in spouse.m_alIndividualEventStructures)
            {
              if (ies.Type == "DEAT")
              {
            if (ies.m_eventDetail != null)
            {
              spouseDeathDate = ies.m_eventDetail.m_dateValue;
              if (spouseDeathDate != null)
              {
                if (m_qdateInferredDeathday == null || m_qdateInferredDeathday.m_date == null || spouseDeathDate.CompareTo(m_qdateInferredDeathday.m_date) <= 0)
                {
                  if (ies.m_eventDetail.m_placeStructure != null)
                  {
                    if (ies.m_eventDetail.m_placeStructure.m_sPlaceName != "")
                      place = String.Concat(" ", MainForm.s_config.m_sPlaceWord, " ", EscapeHTML(ies.m_eventDetail.m_placeStructure.m_sPlaceName, false));
                  }

                  sourceRefs = AddSources(ref m_alReferenceList, ies.m_eventDetail.m_alSourceCitations);

                  if (spouseDeathDate != null)
                  {
                    CIEvent iEvent = new CIEvent(spouseDeathDate, "_SPOUSEDIED", String.Concat("death of ", spouseLink, place, ".", sourceRefs), "", null, false, MainForm.s_config.m_bCapitaliseEventDescriptions);
                    m_alEventList.Add(iEvent);
                  }
                  // else its an attribute.
                  else
                  {
                    CIEvent iEvent = new CIEvent(null, "_SPOUSEDIED", String.Concat("death of ", spouseLink, place, ".", sourceRefs), "", null, false, MainForm.s_config.m_bCapitaliseEventDescriptions);
                    m_alAttributeList.Add(iEvent);
                  }
                }
                break;
              }
            }
              }
            }
              }
              return sourceRefs;
        }
 // Constructor
 public CCreatorRecordIndividual( CGedcom gedcom, IProgressCallback progress, string sW3cfile, CIndividualRecord ir, CCreatorIndexIndividuals indiIndexCreator, CPaintbox paintbox )
     : base(gedcom, progress, sW3cfile)
 {
     m_ir = ir;
       m_indiIndexCreator = indiIndexCreator;
       m_paintbox = paintbox;
       m_htFirstFoundEvent = new Hashtable();
       m_sBirthdaySourceRefs = "";
       m_sDeathdaySourceRefs = "";
       m_sNameTitle = "";
       m_bUnknownName = false;
       m_sName = m_ir.Name;
       m_sNameSuffix = m_ir.NameSuffix;
       m_sFirstName = "";
       m_sSurname = "";
       m_sOccupation = "";
       m_bConcealed = m_ir.Visibility() == CIndividualRecord.EVisibility.Restricted;
       m_alEventList = new ArrayList();
       m_alAttributeList = new ArrayList();
       m_alReferenceList = new ArrayList();
       m_alOccupations = new ArrayList();
       m_sPreviousChildLink = "";
       m_sNextChildLink = "";
       m_alOtherNames = new ArrayList();
       m_qdateInferredBirthday = null;
       m_dateActualBirthday = null;
       m_qdateInferredDeathday = null;
       m_dateActualDeathday = null;
       m_alParents = new ArrayList();
 }
Esempio n. 7
0
        // Recursively visit all individuals connected to this one and record them by adding their xrefs as keys in m_htVisited
        public void PruneMarkConnected( CIndividualRecord ir )
        {
            int nFamily;
            CFamilyRecord fr;

            if( ir.Visibility() == CIndividualRecord.EVisibility.Invisible )
            {
                // Don't follow splits
                return;
            }

            // Mark individual
            m_htVisited[ ir.m_xref ] = true;

            // Mark all ancestors
            nFamily = 0;
            fr = null;
            while( (fr = GetFamilyByChild( ir, nFamily++ )) != null )
            {
                CIndividualRecord irFather = GetHusband( fr );
                if( irFather != null )
                {
                    if( !m_htVisited.ContainsKey( irFather.m_xref ) )
                    {
                        PruneMarkConnected( irFather );
                    }
                }

                CIndividualRecord irMother = GetWife( fr );
                if( irMother != null )
                {
                    if( !m_htVisited.ContainsKey( irMother.m_xref ) )
                    {
                        PruneMarkConnected( irMother );
                    }
                }

                // If both parents are unknown, we can still navigate to the children. Parents appear in minitree as <unknown>, and children also appear.
                // If either mother or father is known, the marking will have happened above.
                if( irMother == null && irFather == null )
                {
                    int i = 0;
                    CIndividualRecord irChild;
                    while ((irChild = fr.GetChildByBirthDate(i)) != null)
                    {
                        i++;
                        if( m_htVisited.ContainsKey( irChild.m_xref ) == false )
                        {
                            PruneMarkConnected( irChild );
                        }
                    }
                }

            }

            // Mark all descendants
            nFamily = 0;
            fr = null;
            while( (fr = GetFamilyBySpouse( ir, nFamily++ )) != null )
            {
                int nChild = 0;
                CIndividualRecord irChild = null;
                while ((irChild = fr.GetChildByBirthDate(nChild++)) != null)
                {
                    if( irChild == null || m_htVisited.ContainsKey( irChild.m_xref ) )
                    {
                        continue;
                    }

                    PruneMarkConnected( irChild );
                }

                // Mark all spouses
                CIndividualRecord irFather = GetHusband( fr );
                if( irFather != ir && irFather != null && !m_htVisited.ContainsKey( irFather.m_xref ) )
                {
                    PruneMarkConnected( irFather );
                }
                CIndividualRecord irMother = GetWife( fr );
                if( irMother != ir && irMother != null && !m_htVisited.ContainsKey( irMother.m_xref ) )
                {
                    PruneMarkConnected( irMother );
                }
            }
        }