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(); }
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(); }