private void ResultList_MouseUp(object sender, MouseEventArgs e)
        {
            if (e.Button == System.Windows.Forms.MouseButtons.Right)
            {
                ContextMenu menu = new ContextMenu();

                menu.MenuItems.Add(new MenuItem("Open...", ResultList_Open_Click));
                menu.MenuItems.Add(new MenuItem("Save...", ResultList_Save_Click));
                menu.MenuItems.Add(new MenuItem("Export text...", ResultList_ExportText_Click));
                menu.MenuItems.Add(new MenuItem("Export HTML...", ResultList_ExportHtml_Click));

                if (parentForm != null)
                {
                    string selectedPerson = parentForm.GetSelectedIndividual();
                    if (selectedPerson != null)
                    {
                        IndividualClass individual = familyTree.GetIndividual(selectedPerson);
                        if (individual != null)
                        {
                            IList <string> urlList = individual.GetUrlList();
                            if (urlList != null)
                            {
                                foreach (string url in urlList)
                                {
                                    menu.MenuItems.Add(new MenuItem(url, ResultList_Url_Click));
                                }
                            }
                        }
                        trace.TraceData(TraceEventType.Warning, 0, "selectedperson = " + selectedPerson);

                        if (stats != null)
                        {
                            AncestorLineInfo selected = stats.GetAncestor(selectedPerson);

                            if (selected != null)
                            {
                                trace.TraceData(TraceEventType.Warning, 0, "selected = " + selected + " dups=" + selected.duplicate.Count);

                                foreach (string duplicate in selected.duplicate)
                                {
                                    menu.MenuItems.Add(new MenuItem(duplicate, ResultList_Url_Click));
                                }
                            }
                            else
                            {
                                trace.TraceData(TraceEventType.Warning, 0, "selected = null");
                            }
                        }
                    }
                }
                menu.Show(this, e.Location, LeftRightAlignment.Right);
            }
        }
Esempio n. 2
0
        public void AddIndividual(IndividualClass individual)
        {
            if (individual == null)
            {
                trace.TraceData(TraceEventType.Error, 0, "GeniCache: Trying to add individual == null");
            }
            else if (individual.GetXrefName().Length == 0)
            {
                trace.TraceEvent(TraceEventType.Error, 0, "GeniCache:AddIndividual():error: no xref!");
            }
            else
            {
                bool relations = false;
                trace.TraceInformation("cached individual " + individual.GetXrefName());

                if (individual.GetFamilyChildList() != null)
                {
                    if (individual.GetFamilyChildList().Count > 0)
                    {
                        relations = true;
                    }
                }
                if (individual.GetFamilySpouseList() != null)
                {
                    if (individual.GetFamilySpouseList().Count > 0)
                    {
                        relations = true;
                    }
                }
                if (!relations)
                {
                    if (individual.GetPublic())
                    {
                        string         url  = "";
                        IList <string> urls = individual.GetUrlList();
                        if (urls.Count > 0)
                        {
                            url = urls[0];
                        }
                        trace.TraceData(TraceEventType.Information, 0, "Person has no relations! " + individual.GetXrefName() + " " + url + " " + individual.GetName());
                    }
                    CheckF2iReferences(ref individual);
                }
                CacheIndividual(individual);
                latestUpdate = DateTime.Now;
            }
        }
Esempio n. 3
0
        void IndividualButton_MouseUp(object sender, MouseEventArgs e)
        {
            if (e.Button == System.Windows.Forms.MouseButtons.Right)
            {
                ContextMenu menu = new ContextMenu();

                menu.MenuItems.Add(new MenuItem("Add parent", AddParent_Click));
                menu.MenuItems.Add(new MenuItem("Add child", AddChild_Click));
                IList <string> urlList = individual.GetUrlList();
                if (urlList != null)
                {
                    foreach (string url in urlList)
                    {
                        menu.MenuItems.Add(new MenuItem(url, Url_Click));
                    }
                }
                menu.Show(this, new Point(0, 0));
            }
        }
Esempio n. 4
0
        string UrlsToString(IndividualClass person)
        {
            IList <string> urlList = person.GetUrlList();
            StringBuilder  builder = new StringBuilder();

            if (urlList != null)
            {
                bool first = true;
                foreach (string url in urlList)
                {
                    if (!first)
                    {
                        builder.Append(" ");
                    }
                    builder.Append(url);
                    first = false;
                }
            }
            return(builder.ToString());
        }
Esempio n. 5
0
        private void ContextMenuStrip_SelectPersons(object sender, MouseEventArgs e)
        {
            if (selectedForm1 != null)
            {
                String          personXref = individual1;
                IndividualClass person     = selectedForm1.GetTree().GetIndividual(personXref);

                if (person != null)
                {
                    IList <string> urlList = person.GetUrlList();
                    if (urlList != null)
                    {
                        foreach (string url in urlList)
                        {
                            Process.Start(url);
                        }
                    }
                }
            }
            if (selectedForm2 != null)
            {
                String          personXref = individual2;
                IndividualClass person     = selectedForm2.GetTree().GetIndividual(personXref);

                if (person != null)
                {
                    IList <string> urlList = person.GetUrlList();
                    if (urlList != null)
                    {
                        foreach (string url in urlList)
                        {
                            Process.Start(url);
                        }
                    }
                }
            }
        }