Exemplo n.º 1
0
        void AddPersonToListView(IndividualClass person)
        {
            string birthAddress          = "";
            string deathAddress          = "";
            IndividualEventClass birthEv = person.GetEvent(IndividualEventClass.EventType.Birth);

            if (birthEv != null)
            {
                AddressClass address = birthEv.GetAddress();
                if (address != null)
                {
                    birthAddress = address.ToString();
                }
            }
            IndividualEventClass deathEv = person.GetEvent(IndividualEventClass.EventType.Death);

            if (deathEv != null)
            {
                AddressClass address = deathEv.GetAddress();
                if (address != null)
                {
                    deathAddress = address.ToString();
                }
            }

            ListViewItem item = new ListViewItem(person.GetName());

            item.SubItems.AddRange(new string[] { person.GetDate(IndividualEventClass.EventType.Birth).ToString(), birthAddress, person.GetDate(IndividualEventClass.EventType.Death).ToString(), deathAddress });
            item.Tag = person.GetXrefName();

            resultList.Items.Add(item);
        }
Exemplo n.º 2
0
        private string CreateToolString()
        {
            string str = xref + "\n";

            if (family != null)
            {
                IndividualEventClass ev = family.GetEvent(IndividualEventClass.EventType.FamMarriage);

                if (ev != null)
                {
                    str += "Married ";

                    FamilyDateTimeClass date = ev.GetDate();

                    if ((date != null) && (date.GetDateType() != FamilyDateTimeClass.FamilyDateType.Unknown))
                    {
                        str += date.ToString();
                    }
                    AddressClass address = ev.GetAddress();
                    if (address != null)
                    {
                        str += " in " + address.ToString();
                    }
                    else
                    {
                        PlaceStructureClass place = ev.GetPlace();

                        if (place != null)
                        {
                            str += " in " + place.ToString();
                        }
                    }
                    str += "\n";
                }
                IList <IndividualXrefClass> childList = family.GetChildList();
                int children = 0;

                if (childList != null)
                {
                    children = childList.Count;
                }
                IList <IndividualXrefClass> parentList = family.GetParentList();
                int parents = 0;

                if (parentList != null)
                {
                    parents = parentList.Count;
                }
                str += parents + " parents and " + children + " children";
            }

            return(str);
        }