/// <summary> /// Get unique taxon categories for all parent taxa. /// This method operates on current taxon tree in contrast to /// the full taxon tree with all taxon tree nodes. /// </summary> /// <returns>Taxon categories for all parent taxons.</returns> public virtual TaxonCategoryList GetParentTaxonCategories() { TaxonCategoryList parentTaxonCategories; parentTaxonCategories = new TaxonCategoryList(); foreach (ITaxon parentTaxon in GetParentTaxa()) { if (!parentTaxonCategories.Contains(parentTaxon.Category)) { parentTaxonCategories.Add(parentTaxon.Category); } } parentTaxonCategories.Sort(); return(parentTaxonCategories); }
/// <summary> /// Get unique taxon categories for all child taxa. /// This method operates on current taxon tree in contrast to /// the full taxon tree with all taxon tree nodes. /// </summary> /// <returns>Taxon categories for all child taxons.</returns> public virtual TaxonCategoryList GetChildTaxonCategories() { TaxonCategoryList childTaxonCategories; childTaxonCategories = new TaxonCategoryList(); foreach (ITaxon childTaxon in GetChildTaxa()) { if (!childTaxonCategories.Exists(childTaxon.Category)) { childTaxonCategories.Add(childTaxon.Category); } } childTaxonCategories.Sort(); return(childTaxonCategories); }