示例#1
0
        private void RunButton_Click(object sender, EventArgs e)
        {
            string script;

            script = scriptTextBox.Text;

            if (!string.IsNullOrWhiteSpace(script))
            {
                ScriptEnvironment engine;

                engine = new ScriptEnvironment();
                engine.AddVariable("simulation", _simulation);

                engine.WrappedExecute(script);

                logTextBox.Text = engine.GetOutput();

                this.LoadFields();
                renderPanel.Invalidate();
            }
            else
            {
                SystemSounds.Beep.Play();
            }
        }