コード例 #1
0
        private static void ThreadProc(object scriptHostParams)
        {
            ScriptHostParams scriptHostParams1 = (ScriptHostParams)scriptHostParams;

            ScriptHost.FileSystem = scriptHostParams1.FileSystem;
            ScriptHost.Engine     = scriptHostParams1.Engine;
            ScriptHost.TwoLetterISOLanguageName = scriptHostParams1.TwoLetterISOLanguageName;
            ScriptHost._thread.Priority         = ThreadPriority.Normal;
            ScriptHost._thread.Name             = "SotsScript";
            App  app  = new App(scriptHostParams1);
            bool flag = false;

            while (!flag)
            {
                lock (ScriptHost._host)
                {
                    if (ScriptHost._quit)
                    {
                        flag = true;
                    }
                }
                ScriptHost._readyForNextUpdate.Set();
                if (!flag)
                {
                    ScriptHost._kickUpdate.WaitOne();
                    ScriptHost._readyForNextUpdate.Reset();
                    app.Update();
                }
            }
            app.Exiting();
        }
コード例 #2
0
 public static void Load(ScriptHostParams p)
 {
     ScriptHost._log          = new Log(p.LogHost);
     ScriptHost._allowConsole = p.AllowConsole;
     if (ScriptHost._thread.IsAlive)
     {
         throw new InvalidOperationException("Previous thread is still alive.");
     }
     ScriptHost._thread.Start((object)p);
 }