Ejemplo n.º 1
0
        public void Match()
        {
            TreeMatchType type = fView.GetTreeMatchType();

            fView.CompareOutput.Clear();
            var tree = fBase.Context.Tree;

            switch (type)
            {
            case TreeMatchType.tmtInternal:
                TreeTools.FindDuplicates(tree, tree, 90 /*min: 80-85*/, DuplicateFoundFunc, AppHost.Progress);
                break;

            case TreeMatchType.tmtExternal:
                TreeTools.CompareTree(fBase.Context, fExternalFile, fView.CompareOutput);
                break;

            case TreeMatchType.tmtAnalysis:
            {
                List <TreeTools.ULIndividual> uln = TreeTools.GetUnlinkedNamesakes(fBase);

                fView.CompareOutput.AppendText("  " + LangMan.LS(LSID.LSID_SearchUnlinkedNamesakes) + ":\r\n");
                if (uln != null && uln.Count > 0)
                {
                    foreach (TreeTools.ULIndividual indiv in uln)
                    {
                        fView.CompareOutput.AppendText("    - [" + indiv.Family + "] " + GKUtils.GetNameString(indiv.IRec, true, false) + "\r\n");
                    }
                }
                else
                {
                    fView.CompareOutput.AppendText("    - not found.");
                }
                break;
            }
            }
        }
Ejemplo n.º 2
0
        private void btnMatch_Click(object sender, EventArgs e)
        {
            TreeMatchType type = GetTreeMatchType();

            ListCompare.Clear();

            switch (type)
            {
            case TreeMatchType.tmtInternal:
                TreeTools.FindDuplicates(fTree, fTree, 90 /*min: 80-85*/, DuplicateFoundFunc, AppHost.Progress);
                break;

            case TreeMatchType.tmtExternal:
                TreeTools.CompareTree(fBase.Context, external_match_db, ListCompare);
                break;

            case TreeMatchType.tmtAnalysis:
            {
                List <TreeTools.ULIndividual> uln = TreeTools.GetUnlinkedNamesakes(fBase);

                ListCompare.AppendText("  " + LangMan.LS(LSID.LSID_SearchUnlinkedNamesakes) + ":\r\n");
                if (uln != null && uln.Count > 0)
                {
                    foreach (TreeTools.ULIndividual indiv in uln)
                    {
                        ListCompare.AppendText("    - [" + indiv.Family + "] " + GKUtils.GetNameString(indiv.IRec, true, false) + "\r\n");
                    }
                }
                else
                {
                    ListCompare.AppendText("    - not found.");
                }
                break;
            }
            }
        }
Ejemplo n.º 3
0
 public void Test_GetUnlinkedNamesakes()
 {
     Assert.Throws(typeof(ArgumentNullException), () => { TreeTools.GetUnlinkedNamesakes(null); });
     List <TreeTools.ULIndividual> uln = TreeTools.GetUnlinkedNamesakes(fBaseWin);
 }