Exemple #1
0
 // Call a method
 internal static object CallMethod(ScriptEngine engine, DynamicFunction f, string defaultVirtualPath,
                                   params object[] args)
 {
     try {
         return(f.Invoke(engine, args));
     } catch (Exception e) {
         if (!ProcessRuntimeException(engine, e, defaultVirtualPath))
         {
             throw;
         }
     }
     return(null);
 }
            private void CallFunction(ScriptEngine engine, DynamicFunction f)
            {
                if (f == null)
                {
                    return;
                }

                try {
                    f.Invoke(engine);
                } catch (Exception e) {
                    if (!EngineHelper.ProcessRuntimeException(engine, e, ScriptVirtualPath))
                    {
                        throw;
                    }
                }
            }