예제 #1
0
        /// <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();
            }
        }
예제 #2
0
        /// <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();
            }
        }