示例#1
0
 /// <summary>
 /// Calls a function with the specified arguments in the script environment.
 /// </summary>
 public JSValue CallFunction(string Name, object[] arguments)
 {
     JSCore.JSObject global = GlobalContext.GetGlobalObject();
     JSCore.JSValue  window = global.GetProperty("window");
     if (window == null || !window.IsObject)
     {
         return(null);
     }
     JSCore.JSObject windowObj = window.ToObject();
     return(windowObj.CallFunction(Name, arguments));
 }
示例#2
0
 internal void CreateWindowScriptObject(JSCore.JSContext context)
 {
     if (ScriptObject != null && context != null)
     {
         JSCore.JSObject global = context.GetGlobalObject();
         JSCore.JSValue  window = global.GetProperty("window");
         if (window == null || !window.IsObject)
         {
             return;
         }
         JSCore.JSObject windowObj = window.ToObject();
         if (windowObj == null)
         {
             return;
         }
         windowObj.SetProperty("external", (object)ScriptObject);
     }
 }