Ejemplo n.º 1
0
        public void StopScript()
        {
            isRunning = false;
            if (programThread != null)
            {
                try
                {
                    if (!programThread.Join(1000))
                    {
#if NETCOREAPP
                        // _programThread.Abort(); => System.PlatformNotSupportedException: Thread abort is not supported on this platform.
                        programThread.Interrupt();
#else
                        programThread.Abort();
#endif
                    }
                }
                catch
                {
                }
                programThread = null;
            }
            if (hgScriptingHost != null)
            {
                hgScriptingHost.OnModuleUpdate(null);
                hgScriptingHost.Reset();
            }
        }
Ejemplo n.º 2
0
 public void StopScript()
 {
     isRunning = false;
     if (programThread != null)
     {
         try
         {
             if (!programThread.Join(1000))
             {
                 programThread.Abort();
             }
         } catch { }
         programThread = null;
     }
     if (hgScriptingHost != null)
     {
         hgScriptingHost.OnModuleUpdate(null);
         hgScriptingHost.Reset();
     }
 }