private IFormula checkFormula(IFormulaCache formulaCache, IFormula formula) { if (formula.IsExplicit()) { return(checkFormulaByType(formulaCache, (ExplicitFormula)formula, AreEqualExplicitFormula)); } if (formula.IsBlackBox()) { return(checkFormulaByType(formulaCache, (BlackBoxFormula)formula, AreEqualBalckBoxFormula)); } if (formula.IsTable()) { return(checkFormulaByType(formulaCache, (TableFormula)formula, AreEqualTableFormula)); } if (formula.IsTableWithOffSet()) { return(checkFormulaByType(formulaCache, (TableFormulaWithOffset)formula, AreEqualTableFormulaWithOffset)); } if (formula.IsDynamic()) { return(checkFormulaByType(formulaCache, (SumFormula)formula, AreEqualSumFormula)); } return(formula); }
/// <summary> /// Returns true if the formula can be added to a <see cref="FormulaCache" /> otherwise false /// </summary> public static bool IsCachable(this IFormula formula) { return(formula.IsExplicit() || formula.IsBlackBox() || formula.IsDynamic() || formula.IsTable() || formula.IsTableWithOffSet() || formula.IsTableWithXArgument()); }