Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        private FormData GetFormData(JsonSet json)
        {
            var formData = new FormData();

            formData.DirectorateName   = json.NAZIV_DIR;
            formData.Number            = json.ARHIVSKI_BR_NAS;
            formData.Date              = json.DATUM;
            formData.EmployeeEmail     = json.EMAIL_RADNIKA;
            formData.ManagerEmail      = json.EMAIL_RUKOVODIOCA;
            formData.SignatoryPosition = json.NAZIV_POTPISNIKA;
            formData.SignatoryFullName = json.POTPISNIK_PREZIME_IME;
            formData.PreambleText      = Preamble.GeneratePreamble(json.ID_ODSUSTVA);
            formData.MainText          = MainText.GenerateMainText(json);
            formData.RationaleText     = Rationale.GenerateRationaleText(json.ID_ODSUSTVA);
            if (json.POL == "Z")
            {
                formData.Deliver = "Zaposlenoj";
            }
            else if (json.POL == "M")
            {
                formData.Deliver = "Zaposlenom";
            }

            return(formData);
        }
Esempio n. 3
0
 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());
     }
 }
Esempio n. 4
0
 public Feature Create(HearingData data)
 {
     return(new CompressorFeature(Compressor, Rationale.CreateSettings(data)));
 }
Esempio n. 5
0
 public CompressorFeatureFactory(Rationale rationale, Compressor compressor)
 {
     Rationale  = rationale;
     Compressor = compressor;
 }
Esempio n. 6
0
 public CompressorFeature(Compressor compressor, Rationale rationale)
 {
     this.compressor = compressor;
     this.rationale  = rationale;
     ResetSettings();
 }