Пример #1
0
        public static void OverrideGlobalFunction(this ActiveScriptEngine engine, string functionName, Action <object[]> action)
        {
            if (engine == null)
            {
                throw new ArgumentNullException("engine");
            }

            var overrider = new FunctionOverrider();

            overrider.WhenCalled(action);
            engine.AddObject(functionName, overrider);
        }
Пример #2
0
        public static void OverrideGlobalFunction <T1, T2, T3, T4, T5, T6>(this ActiveScriptEngine engine, string functionName, Func <T1, T2, T3, T4, T5, T6, object> func)
        {
            if (engine == null)
            {
                throw new ArgumentNullException("engine");
            }

            var overrider = new FunctionOverrider();

            overrider.WhenCalled(func);
            engine.AddObject(functionName, overrider);
        }
Пример #3
0
        public static void OverrideGlobalFunction <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(this ActiveScriptEngine engine, string functionName, Action <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> action)
        {
            if (engine == null)
            {
                throw new ArgumentNullException("engine");
            }

            var overrider = new FunctionOverrider();

            overrider.WhenCalled(action);
            engine.AddObject(functionName, overrider);
        }