Exemplo n.º 1
0
        private void ActionRenameScript()
        {
            ScriptFile item  = this.list.SelectedItem as ScriptFile;
            int        index = this.list.SelectedIndex;

            if (item == null)
            {
                return;
            }

            ScriptListEditorRenameDialog dialog = new ScriptListEditorRenameDialog(this.scriptList, item);
            DialogResult result = dialog.ShowDialog(this);

            if (result != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }

            this.scriptList.DeleteFile(item);
            this.list.Items.Remove(item);

            ScriptFile file = this.scriptList.InsertFile(dialog.result, index);

            file.Code = item.Code;

            this.list.Items.Insert(index, file);
            this.list.SelectedItem = file;
            file.ShowEditor();
        }
Exemplo n.º 2
0
        private void ActionRenameScript()
        {
            ScriptFile item = this.list.SelectedItem as ScriptFile;
            int index = this.list.SelectedIndex;

            if (item == null)
                return;

            ScriptListEditorRenameDialog dialog = new ScriptListEditorRenameDialog(this.scriptList, item);
            DialogResult result = dialog.ShowDialog(this);

            if (result != System.Windows.Forms.DialogResult.OK)
                return;

            this.scriptList.DeleteFile(item);
            this.list.Items.Remove(item);

            ScriptFile file = this.scriptList.InsertFile(dialog.result, index);
            file.Code = item.Code;

            this.list.Items.Insert(index, file);
            this.list.SelectedItem = file;
            file.ShowEditor();
        }