Exemplo n.º 1
0
 /// <summary>
 /// Set taxon categories for specified locale.
 /// </summary>
 /// <param name="taxonCategories">Taxon categories.</param>
 /// <param name="locale">Locale.</param>
 protected override void SetTaxonCategories(TaxonCategoryList taxonCategories,
                                            ILocale locale)
 {
     lock (TaxonCategories)
     {
         TaxonCategories[locale.ISOCode] = taxonCategories;
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Get taxon categories for specified locale.
        /// </summary>
        /// <param name="locale">Locale.</param>
        /// <returns>Taxon categories for specified locale.</returns>
        protected virtual TaxonCategoryList GetTaxonCategories(ILocale locale)
        {
            TaxonCategoryList taxonCategories = null;

            if (TaxonCategories.ContainsKey(locale.ISOCode))
            {
                taxonCategories = (TaxonCategoryList)(TaxonCategories[locale.ISOCode]);
            }
            return(taxonCategories);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Get taxon categories for specified locale.
        /// </summary>
        /// <param name="locale">Locale.</param>
        /// <returns>Taxon categories for specified locale.</returns>
        protected override TaxonCategoryList GetTaxonCategories(ILocale locale)
        {
            TaxonCategoryList taxonCategories = null;

            lock (TaxonCategories)
            {
                if (TaxonCategories.ContainsKey(locale.ISOCode))
                {
                    taxonCategories = (TaxonCategoryList)(TaxonCategories[locale.ISOCode]);
                }
            }
            return(taxonCategories);
        }
        /// <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);
        }
Exemplo n.º 6
0
 /// <summary>
 /// Set taxon categories for specified locale.
 /// </summary>
 /// <param name="taxonCategories">Taxon categories.</param>
 /// <param name="locale">Locale.</param>
 protected virtual void SetTaxonCategories(TaxonCategoryList taxonCategories,
                                           ILocale locale)
 {
     TaxonCategories[locale.ISOCode] = taxonCategories;
 }