/// <summary> /// Loads a module of <see cref="ExcelFunction"/>s to the function repository. /// </summary> /// <param name="module">A <see cref="IFunctionModule"/> that can be used for adding functions</param> public virtual void LoadModule(IFunctionModule module) { foreach (var key in module.Functions.Keys) { var lowerKey = key.ToLower(CultureInfo.InvariantCulture); _functions[lowerKey] = module.Functions[key]; } }
/// <summary> /// Loads a module of <see cref="ExcelFunction"/>s to the function repository. /// </summary> /// <param name="module">A <see cref="IFunctionModule"/> that can be used for adding functions</param> public virtual void LoadModule(IFunctionModule module) { foreach (var key in module.Functions.Keys) { var lowerKey = key.ToLower(); _functions[lowerKey] = module.Functions[key]; } }
/// <summary> /// Loads a module containing custom functions to the formula parser. By using /// this method you can add your own implementations of Excel functions, by /// implementing a <see cref="IFunctionModule"/>. /// </summary> /// <param name="module">A <see cref="IFunctionModule"/> containing <see cref="ExcelFunction"/>s.</param> public void LoadFunctionModule(IFunctionModule module) { _parser.Configure(x => x.FunctionRepository.LoadModule(module)); }
/// <summary> /// Loads a module of <see cref="ExcelFunction"/>s to the function repository. /// </summary> /// <param name="module">A <see cref="IFunctionModule"/> that can be used for adding functions and custom function compilers.</param> public virtual void LoadModule(IFunctionModule module) { foreach (var key in module.Functions.Keys) { var lowerKey = key.ToLower(CultureInfo.InvariantCulture); _functions[lowerKey] = module.Functions[key]; } foreach (var key in module.CustomCompilers.Keys) { this.CustomCompilers[key] = module.CustomCompilers[key]; } }