text: public static int CountArg(ValueEval eval, IMatchPredicate criteriaPredicate){if (eval == null){throw new ArgumentException("eval must not be null");}if (eval is ThreeDEval){return CountUtils.CountMatchingCellsInArea((ThreeDEval)eval, criteriaPredicate);}if (eval is TwoDEval){throw new ArgumentException("Count requires 3D Evals, 2D ones aren't supported");}if (eval is RefEval){return CountUtils.CountMatchingCellsInRef((RefEval)eval, criteriaPredicate);}return criteriaPredicate.Matches(eval) ? 1 : 0;}