Example #1
0
        public void ImportNode(TaxonTreeNode _where, TaxonTreeNode _what)
        {
            if (_what.Desc.Name == "__ignore__" || _where.Desc.RefMultiName.ItsOneOfMyNames(_what.Desc.RefMultiName.Main))
            {
                foreach (TaxonTreeNode node in _what.Children)
                {
                    _where.AddChild(node);
                }
            }
            else
            {
                _where.AddChild(_what);
            }

            _where.SortChildren();
            _where.Expand();
            TaxonUtils.OriginalRoot.UpdateRedListCategoryFlags();
            RefreshGraph();
        }
Example #2
0
        //-------------------------------------------------------------------
        public void AddChild(TaxonTreeNode _taxon)
        {
            if (_taxon == null)
            {
                return;
            }

            string firstName = null;

            if (_taxon.Desc.ClassicRank == ClassicRankEnum.Genre)
            {
                firstName = _taxon.Desc.RefMainName;
            }
            TaxonDialog.NewTaxon dlg = new TaxonDialog.NewTaxon(firstName)
            {
                TopMost        = true,
                CheckNameUsage = true
            };
            dlg.ShowDialog();
            if (dlg.DialogResult != DialogResult.OK)
            {
                return;
            }

            TaxonDesc newTaxon = new TaxonDesc(dlg.TaxonName);

            if (_taxon.Desc.ClassicRank == ClassicRankEnum.Genre)
            {
                newTaxon.ClassicRank = ClassicRankEnum.Espece;
            }
            else if (_taxon.Desc.ClassicRank == ClassicRankEnum.Espece)
            {
                newTaxon.ClassicRank = ClassicRankEnum.SousEspece;
            }

            TaxonTreeNode newNode = new TaxonTreeNode(newTaxon);

            _taxon.AddChild(newNode);
            _taxon.SortChildren();
            _taxon.Expand();
            RefreshGraph();
        }