/// <summary> /// Method to create an empty script. /// </summary> void CreateScript() { var name = new NameForm(); if (name.ShowDialog() == DialogResult.OK) { var script = File.Create(MakeScriptName(name.Value)); script.Close(); UpdateScriptsDirectory(); } }
/// <summary> /// Method to rename the script. /// </summary> void RenameScript() { string script = scripts_list.SelectedItem.ToString(); if (script != MAIN_SCRIPT) { var name = new NameForm(script); if (name.ShowDialog() == DialogResult.OK) { File.Move(MakeScriptName(script), MakeScriptName(name.Value)); UpdateScriptsDirectory(); } } else { MainScriptError(); } }