private void MenuItem_Click(object sender, RoutedEventArgs e)
{
if (Modified)//if any modification done to command scripts after last Save
{ //allow user to save changes before opening another command script
System.Windows.Forms.DialogResult dresult = System.Windows.Forms.MessageBox.Show(
"Do you want to save commands?",
"Save & Close current command script?",
System.Windows.Forms.MessageBoxButtons.YesNoCancel,
System.Windows.Forms.MessageBoxIcon.Question);
if (dresult == System.Windows.Forms.DialogResult.Yes)//Yes Save- and Close
{
SyntaxEditorSaveAs();
}
else if (dresult == System.Windows.Forms.DialogResult.No)//No Save- but Close
{
}
else//no Save no Close
{
return;
}
}
inputTextbox.Text = string.Empty;
this.Activate();
}