public ScriptListEditorRenameDialog(ScriptListFile scriptListFile, ScriptFile file) { this.scriptListFile = scriptListFile; this.file = file; InitializeComponent(); this.textBox3.Text = this.file.ToString(); this.textBox1.Text = this.file.ToString(); this.Shown += new EventHandler(ScriptListEditorRenameDialog_Shown); }
public ScriptListEditor(ScriptListFile item) : base(item) { list.Dock = DockStyle.Fill; this.Controls.Add(list); this.Text = "脚本列表"; this.DockAreas = WeifenLuo.WinFormsUI.Docking.DockAreas.DockBottom | WeifenLuo.WinFormsUI.Docking.DockAreas.DockLeft | WeifenLuo.WinFormsUI.Docking.DockAreas.DockRight | WeifenLuo.WinFormsUI.Docking.DockAreas.DockTop | WeifenLuo.WinFormsUI.Docking.DockAreas.Document | WeifenLuo.WinFormsUI.Docking.DockAreas.Float; scriptList = item; foreach (ScriptFile file in scriptList.scripts) { this.list.Items.Add(file); } ContextMenuStrip menu = new ContextMenuStrip(); (menuOpen = menu.Items.Add("打开(&O)", null, delegate { ActionOpenScript(); }) as ToolStripMenuItem).ShortcutKeyDisplayString = "Enter"; menu.Items.Add(new ToolStripSeparator()); (menuInsert = menu.Items.Add("插入(&I)...", null, delegate { ActionInsertScript(); }) as ToolStripMenuItem).ShortcutKeyDisplayString = "Insert"; (menuDelete = menu.Items.Add("删除(&D)", null, delegate { ActionDeleteScript(); }) as ToolStripMenuItem).ShortcutKeyDisplayString = "Delete"; (menuRename = menu.Items.Add("重命名(&R)...", null, delegate { ActionRenameScript(); }) as ToolStripMenuItem).ShortcutKeyDisplayString = "F2"; menu.Opening += delegate(object sender, System.ComponentModel.CancelEventArgs args) { this.menuOpen.Enabled = this.list.SelectedItem != null; this.menuDelete.Enabled = this.list.SelectedItem != null; this.menuRename.Enabled = this.list.SelectedItem != null; }; this.list.ContextMenuStrip = menu; this.list.AllowDrop = true; this.list.MouseMove += new MouseEventHandler(list_MouseMove); this.list.DragEnter += new DragEventHandler(list_DragEnter); this.list.DragDrop += new DragEventHandler(list_DragDrop); this.list.KeyDown += new KeyEventHandler(list_KeyDown); this.list.DoubleClick += new EventHandler(list_DoubleClick); }
public ScriptListEditorInsertDialog(ScriptListFile scriptListFile) { this.scriptListFile = scriptListFile; InitializeComponent(); }