コード例 #1
0
 public void Test_FindDuplicates()
 {
     Assert.Throws(typeof(ArgumentNullException), () => { TreeTools.FindDuplicates(null, null, 0.0f, null, null); });
     Assert.Throws(typeof(ArgumentNullException), () => { TreeTools.FindDuplicates(fBaseWin.Context.Tree, null, 0.0f, null, null); });
     Assert.Throws(typeof(ArgumentNullException), () => { TreeTools.FindDuplicates(null, fBaseWin.Context.Tree, 0.0f, null, null); });
     Assert.Throws(typeof(ArgumentNullException), () => { TreeTools.FindDuplicates(fBaseWin.Context.Tree, fBaseWin.Context.Tree, 0.0f, null, null); });
     Assert.Throws(typeof(ArgumentNullException), () => { TreeTools.FindDuplicates(fBaseWin.Context.Tree, fBaseWin.Context.Tree, 0.0f, null, fProgress); });
 }
コード例 #2
0
        public void Test_FindDuplicates()
        {
            var progress = Substitute.For <IProgressController>();

            Assert.Throws(typeof(ArgumentNullException), () => { TreeTools.FindDuplicates(null, null, 0.0f, null, null); });
            Assert.Throws(typeof(ArgumentNullException), () => { TreeTools.FindDuplicates(fBaseWin.Context.Tree, null, 0.0f, null, null); });
            Assert.Throws(typeof(ArgumentNullException), () => { TreeTools.FindDuplicates(null, fBaseWin.Context.Tree, 0.0f, null, null); });
            Assert.Throws(typeof(ArgumentNullException), () => { TreeTools.FindDuplicates(fBaseWin.Context.Tree, fBaseWin.Context.Tree, 0.0f, null, null); });
            Assert.Throws(typeof(ArgumentNullException), () => { TreeTools.FindDuplicates(fBaseWin.Context.Tree, fBaseWin.Context.Tree, 0.0f, null, progress); });
        }
コード例 #3
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;
            }
            }
        }
コード例 #4
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;
            }
            }
        }