Ejemplo n.º 1
0
        public void RunAsync()
        {
            runner_?.Stop();
            runner_ = null;

            /* ファイル存在確認 */
            if ((script_path_ == null) ||
                (!File.Exists(script_path_))
                )
            {
                return;
            }

            /* スクリプト読み込み */
            var script_code = (string)null;

            try {
                script_code = File.ReadAllText(script_path_);
            } catch {
                return;
            }

            if (script_code.Length == 0)
            {
                return;
            }

            /* 実行 */
            runner_ = new ScriptCodeRunner(script_code);
            runner_.StatusChanged   += Runner_StatusChanged;
            runner_.MessageAppended += Runner_MessageAppended;
            runner_.CommentUpdated  += Runner_CommentUpdated;
            runner_.RunAsync();
        }
Ejemplo n.º 2
0
 internal ScriptSandbox(ScriptCodeRunner runner, Thread script_thread)
 {
     this.runner = runner;
     thread_     = script_thread;
 }