コード例 #1
0
 internal void Stop()
 {
     //this.Reset();
     //
     this.IsRunning = false;
     this.IsEvaluatingConditionBlock = false;
     //
     if (ProgramThread != null)
     {
         try
         {
             ProgramThread.Abort();
         }
         catch { }
         //
         ProgramThread = null;
     }
     //
     //TODO: complete cleanup and deallocation stuff here
     ModuleIsChangingHandler = null;
     ModuleChangedHandler    = null;
     //
     foreach (string apicall in _registeredapicalls)
     {
         _homegenie.UnRegisterDynamicApi(apicall);
     }
     _registeredapicalls.Clear();
 }
コード例 #2
0
 internal void Stop()
 {
     this.IsRunning = false;
     if (this.Stopping != null)
     {
         try { Stopping(); } catch { }
     }
     this.Reset();
     //
     if (ProgramThread != null)
     {
         try
         {
             ProgramThread.Abort();
             ProgramThread.Join(100);
         }
         catch
         {
         }
         //
         ProgramThread = null;
     }
     //
     //TODO: complete cleanup and deallocation stuff here
     //
     ModuleIsChangingHandler = null;
     ModuleChangedHandler    = null;
     SystemStarted           = null;
     SystemStopping          = null;
     Stopping = null;
     //
     foreach (string apiCall in registeredApiCalls)
     {
         homegenie.UnRegisterDynamicApi(apiCall);
     }
     registeredApiCalls.Clear();
     //
     switch (codeType.ToLower())
     {
     case "python":
     case "ruby":
         (scriptEngine as ScriptEngine).Runtime.Shutdown();
         break;
         //case "javascript":
         //case "csharp":
     }
 }