Пример #1
0
 public void CopyLibraries(InputContext target)
 {
     foreach (var kvp in Libs)
     {
         target.SetLibrary(kvp.Key, kvp.Value);
     }
 }
Пример #2
0
        /*public static Expression GetFunctionExpression(Expression funcexp, Expression argexp,
         *  Dictionary<string, Exline> customFuncs,
         *  Expression argParams, ParameterExpression inputParams, ParameterExpression inputContextParam,
         *  List<InputVar> compiledInputVarsList,
         *  InputContext context)
         * {
         *
         * }*/

        public static void ImportLibrary(string libname, string asname, InputContext context)
        {
            foreach (ILibraryProvider libProvider in context.LibraryProviders)
            {
                ILibrary lib = libProvider.LoadLibrary(libname);
                if (lib != null)
                {
                    context.SetLibrary(asname, lib);
                    return; // found the library
                }
            }
            // did not find the library
            throw new Exception("Library not found '" + libname + "'");
        }