Example #1
0
        public static object GetFuncNROnErrorTrap()
        {
            var p = Type.GetType("NRaas.ErrorTrap, NRaasErrorTrap");

            if (p == null)
            {
                return(null);
            }

            var r = (MethodInfo)NFinalizeDeath.GetGoodMethods(
                p,
                new Type[] { typeof(ScriptCore.ScriptProxy), typeof(Exception) },
                "OnScriptError",
                BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic
                );

            if (r == null)
            {
                return(null);
            }

            // Required if no create method pointer.
            Delegate.CreateDelegate(typeof(SCOSR._SafeScriptError), r);

            return(r);
        }