/// <summary>
 /// Resets the cohort selectors for another prescription
 /// </summary>
 public static void ClearCohortSelectors()
 {
     if (CohortSelectors != null)
     {
         CohortSelectors.Clear();
     }
     if (AdditionalCohortSelectors != null)
     {
         AdditionalCohortSelectors.Clear();
     }
     if (treeremovals != null)
     {
         treeremovals.Clear();
     }
 }
Example #2
0
 /// <summary>
 /// Resets the cohort selectors for another prescription
 /// </summary>
 public static void ClearCohortSelectors()
 {
     if (CohortSelectors != null)
     {
         CohortSelectors.Clear();
     }
     if (AdditionalCohortSelectors != null)
     {
         AdditionalCohortSelectors.Clear();
     }
     if (percentages != null)
     {
         percentages.Clear();
     }
 }
        //---------------------------------------------------------------------

        /// <summary>
        /// Creates and stores a specific-ages cohort selector for a species
        /// if at least one percentage was found among the list of ages and
        /// ranges that were read.
        /// </summary>
        /// <returns>
        /// True if a selector was created and stored in the CohortSelectors
        /// property.  False is returned if no selector was created because
        /// there were no percentages read for any age or range.
        /// </returns>
        public static bool CreateCohortSelectorFor(ISpecies species,
                                                   IList <ushort> ages,
                                                   IList <AgeRange> ageRanges)
        {
            if (percentage == null)
            {
                return(false);
            }
            else
            {
                LandCoverCohortSelector lccs = new LandCoverCohortSelector(ages, ageRanges, percentages);
                if (CohortSelectors.ContainsKey(species.Name))
                {
                    Model.Core.UI.WriteLine("Contains species: " + species.Name);
                }
                CohortSelectors[species.Name] = lccs;
                percentage = null;
                return(true);
            }
        }