static TimingInterfaceVsDelegateCalls() { _mathFunctionClass = new SquareFunction(); _mathFunctionInterface = _mathFunctionClass; _calculate = _mathFunctionInterface.Calculate; _derivate = _mathFunctionInterface.Derivate; }
/// <summary> /// Add new global math function to use in Functions /// </summary> /// <param name="func"></param> public static void RegisterMathFunction(IMathFunction func) { if (Function.GetMathFunction(func.FunctionName) != null) { throw new InvalidFunctionStringException(func.FunctionName); } Function._allFunctions.Add(func); }