예제 #1
0
 public void Unload()
 {
     if (scriptEngine != null)
     {
         Reset();
         scriptEngine.Runtime.Shutdown();
         scriptEngine = null;
     }
     hgScriptingHost = null;
     scriptScope = null;
 }
예제 #2
0
        public bool Load()
        {
            if (homegenie == null)
                return false;

            if (hgScriptingHost != null)
            {
                this.Reset();
                hgScriptingHost = null;
            }
            hgScriptingHost = new ScriptingHost();
            hgScriptingHost.SetHost(homegenie, programBlock.Address);

            return true;
        }
예제 #3
0
        public bool Load()
        {
            Unload();

            if (homegenie == null)
                return false;

            scriptEngine = new Engine();

            hgScriptingHost = new ScriptingHost();
            hgScriptingHost.SetHost(homegenie, programBlock.Address);
            scriptEngine.SetValue("hg", hgScriptingHost);

            return true;
        }
예제 #4
0
        public bool Load()
        {
            Unload();

            if (homegenie == null)
                return false;

            scriptEngine = Python.CreateEngine();

            hgScriptingHost = new ScriptingHost();
            hgScriptingHost.SetHost(homegenie, programBlock.Address);
            dynamic scope = scriptScope = scriptEngine.CreateScope();
            scope.hg = hgScriptingHost;

            return true;
        }
예제 #5
0
 public void Unload()
 {
     Reset();
     hgScriptingHost = null;
 }
예제 #6
0
 private void SetupScriptingScope()
 {
     hgScriptingHost = new ScriptingHost();
     hgScriptingHost.SetHost(homegenie, this.Address);
     if (scriptEngine.GetType() == typeof(ScriptEngine))
     {
         // IronPyton and IronRuby engines
         ScriptEngine currentEngine = (scriptEngine as ScriptEngine);
         dynamic scope = scriptScope = currentEngine.CreateScope();
         scope.hg = hgScriptingHost;
     }
     else if (scriptEngine.GetType() == typeof(Jint.Engine))
     {
         // Jint Javascript engine
         Jint.Engine javascriptEngine = (scriptEngine as Jint.Engine);
         javascriptEngine.SetValue("hg", hgScriptingHost);
     }
 }
예제 #7
0
 internal void Reset()
 {
     // CSharp App
     if (appAssembly != null && methodReset != null)
     {
         methodReset.Invoke(assembly, null);
     }
     // Python, Ruby, Javascript
     else if (hgScriptingHost != null)
     {
         hgScriptingHost.Reset();
         hgScriptingHost = null;
     }
 }
예제 #8
0
 public void Unload()
 {
     Reset();
     scriptEngine = null;
     hgScriptingHost = null;
 }
예제 #9
0
 private void SetupScriptingScope()
 {
     if (hgScriptingHost != null)
     {
         this.Reset();
         hgScriptingHost = null;
     }
     hgScriptingHost = new ScriptingHost();
     hgScriptingHost.SetHost(homegenie, this.Address);
     if (scriptEngine.GetType() == typeof(ScriptEngine))
     {
         // IronPyton and IronRuby engines
         var ironEngine = (scriptEngine as ScriptEngine);
         dynamic scope = scriptScope = ironEngine.CreateScope();
         scope.hg = hgScriptingHost;
     }
     else if (scriptEngine.GetType() == typeof(Jint.Engine))
     {
         // Jint Javascript engine
         var javascriptEngine = (scriptEngine as Jint.Engine);
         javascriptEngine.SetValue("hg", hgScriptingHost);
     }
     else if (scriptEngine.GetType() == typeof(WizardEngine))
     {
         var wizardEngine = (scriptEngine as WizardEngine);
         wizardEngine.SetScriptingHost(hgScriptingHost);
     }
 }
예제 #10
0
 public void SetScriptingHost(ScriptingHost scriptingHost)
 {
     this.scriptingHost = scriptingHost;
 }