コード例 #1
0
 public bool ScriptCompile()
 {
     StatusShowLog("开始编译...");
     try
     {
         _eventdisabled = true;
         _program       = new Script.Script();
         _program.Parse(textBoxScript.Text);
         textBoxScript.Text = _program.ToCode();
         textBoxScript.Select(0, 0);
         return(true);
     }
     catch (ParseException ex)
     {
         _program = null;
         string str = $"{ex.Message}: 行{ex.Index + 1}";
         SystemSounds.Hand.Play();
         MessageBox.Show(str);
         StatusShowLog(str);
         ScriptSelectLine(ex.Index);
         return(false);
     }
     finally
     {
         _eventdisabled = false;
     }
 }
コード例 #2
0
 private void textBoxScript_TextChanged(object sender, EventArgs e)
 {
     if (_eventdisabled)
     {
         return;
     }
     _fileEdited = true;
     _program    = null;
 }