Example #1
0
 private RedListCalculator GetRedListCalculator(Boolean refresh)
 {
     if (_redListCalculator.IsNull() || refresh)
     {
         _redListCalculator = new RedListCalculator(null, null);
     }
     return(_redListCalculator);
 }
        private RedListCalculator GetRedListCalculator(Boolean refresh = false)
        {
            if (_redListCalculator.IsNull() || refresh)
            {
                _redListCalculator = new RedListCalculator(GetUserContext(), null, null);
            }

            return(_redListCalculator);
        }
 /// <summary>
 /// Init calculation of red list criteria.
 /// </summary>
 /// <param name="speciesFacts">Species facts to get data from.</param>
 public override void Init(SpeciesFactList speciesFacts)
 {
     if (AllowAutomaticUpdate)
     {
         RedListCalculator = new RedListCalculator(Taxon.TaxonType.Name, Taxon.TaxonType.NameDefinite);
         RedListCalculator.IsCriteriaCalculated = false;
         base.Init(speciesFacts);
         SetReadListValues();
     }
 }
 /// <summary>
 /// Init calculation of red list criteria.
 /// </summary>
 /// <param name="userContext">
 /// Information about the user that makes this method call.
 /// </param>
 /// <param name="speciesFacts">Species facts to get data from.</param>
 public override void Init(IUserContext userContext,
                           SpeciesFactList speciesFacts)
 {
     if (AllowAutomaticUpdate && !IsInitialized)
     {
         RedListCalculator = new RedListCalculator(userContext,
                                                   Taxon.Category.Name,
                                                   Taxon.Category.NameDefinite);
         RedListCalculator.IsCriteriaCalculated = false;
         base.Init(userContext, speciesFacts);
         SetReadListValues();
     }
 }
 /// <summary>
 /// Creates a species fact instance with data from web service.
 /// </summary>
 /// <param name="id">Id of the species fact</param>
 /// <param name="sortOrder">Sort order of the species fact</param>
 /// <param name="taxon">Taxon of the species fact</param>
 /// <param name="individualCategoryId">Individual Category Id of the species fact</param>
 /// <param name="factorId">Foctor Id of the species fact</param>
 /// <param name="host">Host taxon associated with the species fact</param>
 /// <param name="hasHost">Indicates if this species fact has a host.</param>
 /// <param name="periodId">Period Id of the species fact</param>
 /// <param name="hasPeriod">Indicates if this species fact has a period.</param>
 /// <param name="fieldValue1">Field value of field 1 for the species fact</param>
 /// <param name="hasFieldValue1">Indicates if field 1 has a value.</param>
 /// <param name="fieldValue2">Field value of field 2 for the species fact</param>
 /// <param name="hasFieldValue2">Indicates if field 2 has a value.</param>
 /// <param name="fieldValue3">Field value of field 3 for the species fact</param>
 /// <param name="hasFieldValue3">Indicates if field 3 has a value.</param>
 /// <param name="fieldValue4">Field value of field 4 for the species fact</param>
 /// <param name="hasFieldValue4">Indicates if field 4 has a value.</param>
 /// <param name="fieldValue5">Field value of field 5 for the species fact</param>
 /// <param name="hasFieldValue5">Indicates if field 5 has a value.</param>
 /// <param name="qualityId">Quality Id of the species fact</param>
 /// <param name="referenceId">Reference id of the species fact</param>
 /// <param name="updateUserFullName">Full Name of the pdate user of the species fact</param>
 /// <param name="updateDate">Update date of the species fact</param>
 public SpeciesFactRedList(
     Int32 id,
     Int32 sortOrder,
     Taxon taxon,
     Int32 individualCategoryId,
     Int32 factorId,
     Taxon host,
     Boolean hasHost,
     Int32 periodId,
     Boolean hasPeriod,
     Double fieldValue1,
     Boolean hasFieldValue1,
     Double fieldValue2,
     Boolean hasFieldValue2,
     Double fieldValue3,
     Boolean hasFieldValue3,
     String fieldValue4,
     Boolean hasFieldValue4,
     String fieldValue5,
     Boolean hasFieldValue5,
     Int32 qualityId,
     Int32 referenceId,
     String updateUserFullName,
     DateTime updateDate)
     : base(id,
            sortOrder,
            taxon,
            individualCategoryId,
            factorId,
            host,
            hasHost,
            periodId,
            hasPeriod,
            fieldValue1,
            hasFieldValue1,
            fieldValue2,
            hasFieldValue2,
            fieldValue3,
            hasFieldValue3,
            fieldValue4,
            hasFieldValue4,
            fieldValue5,
            hasFieldValue5,
            qualityId,
            referenceId,
            updateUserFullName,
            updateDate)
 {
     IsInInit          = false;
     RedListCalculator = new RedListCalculator(taxon.TaxonType.Name, taxon.TaxonType.NameDefinite);
 }
Example #6
0
 public RedListCalculatorTest()
 {
     _redListCalculator = null;
 }