private void AddButton_Click(object sender, EventArgs e) { using (ToolDetailForm win = new ToolDetailForm("Add Tool")) { if (win.ShowDialog() == System.Windows.Forms.DialogResult.OK) { ToolList.Items.Add(win.Tool); } } }
private void ToolList_DoubleClick(object sender, EventArgs e) { Tool tool = ToolList.SelectedItem as Tool; if (tool != null) { int idx = ToolList.SelectedIndex; using (ToolDetailForm win = new ToolDetailForm(tool, "Edit Tool")) { if (win.ShowDialog() == System.Windows.Forms.DialogResult.OK) { tool.Args = win.Tool.Args; tool.Title = win.Tool.Title; tool.Path = win.Tool.Path; ToolList.Items.Insert(idx, tool); ToolList.Items.RemoveAt(idx + 1); } } } }
private void SetToolLink() { using (ToolDetailForm win = new ToolDetailForm(this.Tool, "Set Info Link")) { if (win.ShowDialog() == System.Windows.Forms.DialogResult.OK) { this.Tool = win.Tool; Dirty = true; SetToolLinkToolTip(); } } }