예제 #1
0
 // Token: 0x060004C4 RID: 1220 RVA: 0x0001E0A4 File Offset: 0x0001C2A4
 public string PreProcessFormula(string formula, ThresholdLevel level, ThresholdOperatorEnum thresholdOperator)
 {
     if (string.IsNullOrEmpty(formula))
     {
         return(formula);
     }
     if (!this.IsUseBaselineMacro(formula))
     {
         return(formula);
     }
     if (this.IsMacro(BusinessLayerSettings.Instance.ThresholdsUseBaselineCriticalCalculationMacro, formula))
     {
         level = ThresholdLevel.Critical;
     }
     if (this.IsMacro(BusinessLayerSettings.Instance.ThresholdsUseBaselineWarningCalculationMacro, formula))
     {
         level = ThresholdLevel.Warning;
     }
     if (CoreThresholdPreProcessor.IsGreaterOperator(thresholdOperator))
     {
         if (level != ThresholdLevel.Critical)
         {
             return(BusinessLayerSettings.Instance.ThresholdsDefaultWarningFormulaForGreater);
         }
         return(BusinessLayerSettings.Instance.ThresholdsDefaultCriticalFormulaForGreater);
     }
     else
     {
         if (level != ThresholdLevel.Critical)
         {
             return(BusinessLayerSettings.Instance.ThresholdsDefaultWarningFormulaForLess);
         }
         return(BusinessLayerSettings.Instance.ThresholdsDefaultCriticalFormulaForLess);
     }
 }
 public string PreProcessFormula(
   string formula,
   ThresholdLevel level,
   ThresholdOperatorEnum thresholdOperator)
 {
   if (string.IsNullOrEmpty(formula) || !this.IsUseBaselineMacro(formula))
     return formula;
   if (this.IsMacro(BusinessLayerSettings.Instance.ThresholdsUseBaselineCriticalCalculationMacro, formula))
     level = (ThresholdLevel) 2;
   if (this.IsMacro(BusinessLayerSettings.Instance.ThresholdsUseBaselineWarningCalculationMacro, formula))
     level = (ThresholdLevel) 1;
   return CoreThresholdPreProcessor.IsGreaterOperator(thresholdOperator) ? (level != 2 ? BusinessLayerSettings.Instance.ThresholdsDefaultWarningFormulaForGreater : BusinessLayerSettings.Instance.ThresholdsDefaultCriticalFormulaForGreater) : (level != 2 ? BusinessLayerSettings.Instance.ThresholdsDefaultWarningFormulaForLess : BusinessLayerSettings.Instance.ThresholdsDefaultCriticalFormulaForLess);
 }