Exemplo n.º 1
0
 public static void EnsureScriptComponent()
 {
     if (_engineWrapper == null)
     {
         lock (_initLock)
         {
             if (_engineWrapper == null)
             {
                 EngineNativeWrapper engineWrapper = new EngineNativeWrapper();
                 engineWrapper.Engine       = new V8ScriptEngine();
                 engineWrapper.Native       = new NativeFunctions(engineWrapper, BaseUrl);
                 engineWrapper.ScriptSource = ScriptHelper.GetCode(false, "_0040_CallbacksIntoDotNet.WrapperAbstraction.js", "_0040_CallbacksIntoDotNet.Employee.js");
                 engineWrapper.Engine.AddHostObject("nativeFunctions", engineWrapper.Native);
                 engineWrapper.Engine.Execute(engineWrapper.ScriptSource);
                 _engineWrapper = engineWrapper;
             }
         }
     }
 }
 public NativeFunctions(EngineNativeWrapper engine, string baseUrl)
 {
     _engine  = engine;
     _baseUrl = baseUrl;
 }