예제 #1
0
        public static void OverrideGlobalFunction <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(this ActiveScriptEngine engine, string functionName, Action <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> 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>(this ActiveScriptEngine engine, string functionName, Func <T1, object> func)
        {
            if (engine == null)
            {
                throw new ArgumentNullException("engine");
            }

            var overrider = new FunctionOverrider();

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