public bool Analyze(HealthcheckData healthcheckData, ICollection <DomainKey> AllowedMigrationDomains) { bool hasTheRuleMatched = false; // PingCastle 2.5 Points = 0; int?valueReturnedByAnalysis = AnalyzeDataNew(healthcheckData, AllowedMigrationDomains); if (valueReturnedByAnalysis == null) { valueReturnedByAnalysis = 0; if (Details != null) { valueReturnedByAnalysis = Details.Count; } } foreach (var computation in RuleComputation) { int points = 0; if (computation.HasMatch((int)valueReturnedByAnalysis, ref points)) { hasTheRuleMatched = true; Points = points; if (DetailRationale != null) { Rationale = DetailRationale; Rationale = Rationale.Replace("{count}", valueReturnedByAnalysis.ToString()); Rationale = Rationale.Replace("{threshold}", computation.Threshold.ToString()); } break; } } return(hasTheRuleMatched); }
protected virtual void UpdateLabelsAfterMatch(int valueReturnedByAnalysis, RuleComputationAttribute computation) { if (DetailRationale != null) { Rationale = DetailRationale; Rationale = Rationale.Replace("{count}", valueReturnedByAnalysis.ToString()); Rationale = Rationale.Replace("{threshold}", computation.Threshold.ToString()); } }