/// <summary> /// Get all child taxa. /// Parent taxa are also included in the result. /// </summary> /// <param name="taxonTree">Taxon tree.</param> /// <param name="taxa">Aggregated taxa.</param> private void GetChildTaxa(TaxonTreeNode taxonTree, TaxonList taxa) { taxa.Merge(taxonTree.Taxon); if (taxonTree.Children.IsNotEmpty()) { foreach (TaxonTreeNode childTaxonTree in taxonTree.Children) { GetChildTaxa(childTaxonTree, taxa); } } }
/// <summary> /// Get all child taxa. /// Parent taxa are also included in the result. /// </summary> /// <param name="parentTaxonIds">Ids for parent taxa.</param> /// <param name="taxonInformationType">Type of taxon information to get.</param> /// <returns>All child taxa.</returns> public TaxonList GetChildTaxa(List <Int32> parentTaxonIds, TaxonInformationType taxonInformationType) { TaxonList childTaxa; TaxonTreeNodeList taxonTrees; TaxonTreeSearchCriteria taxonTreeSearchCriteria; taxonTreeSearchCriteria = new TaxonTreeSearchCriteria(); taxonTreeSearchCriteria.RestrictSearchToTaxonIds = parentTaxonIds; taxonTreeSearchCriteria.TaxonInformationType = taxonInformationType; taxonTrees = ArtDatabanken.Data.ArtDatabankenService.TaxonManager.GetTaxonTreesBySearchCriteria( taxonTreeSearchCriteria); childTaxa = new TaxonList(true); if (taxonTrees.IsNotEmpty()) { foreach (TaxonTreeNode taxonTree in taxonTrees) { GetChildTaxa(taxonTree, childTaxa); } } return(childTaxa); }