private void _TestCompile_Button_Click(object sender, EventArgs e) { ExcelScript script = new ExcelScript(_fileManager); try { script.Compile(_scriptEditor_RichTextBox.Text); } catch (Exception ex) { MessageBox.Show("Failed to compile script!\n\n" + ex, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void _Save_Button_Click(object sender, EventArgs e) { DialogResult dr = DialogResult.Yes; if (_textChanged) { dr = MessageBox.Show("Changes to the script have been made, attempt to compile the script and save befor exiting?", "Save Changes?", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); } if (dr == DialogResult.Cancel) { return; } if (dr == DialogResult.No) { Close(); return; } ExcelScript script = new ExcelScript(_fileManager); try { script.Compile(_scriptEditor_RichTextBox.Text); } catch (Exception ex) { MessageBox.Show("Failed to compile script!\n\n" + ex, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); dr = MessageBox.Show("Do you wish to still quit?", "Quit without saving?", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr == DialogResult.No) { return; } if (dr == DialogResult.Yes) { Close(); return; } } _dataGridViewCell.Value = _scriptEditor_RichTextBox.Text; }