/// <summary> /// User clicked on the Add button to add a new tool. /// </summary> private void BtAddClick(object sender, EventArgs e) { FormEditTools formEditTools = new FormEditTools(new ClassTool()); if (formEditTools.ShowDialog() == DialogResult.OK) { int sel = listTools.SelectedIndex >= 0 ? listTools.SelectedIndex : 0; CustomTools.Tools.Insert(sel, formEditTools.Tool); RefreshList(); } }
/// <summary> /// User clicked on the Edit button to edit selected tool. /// </summary> private void BtEditClick(object sender, EventArgs e) { int sel = listTools.SelectedIndex; FormEditTools formEditTools = new FormEditTools(CustomTools.Tools[sel]); if (formEditTools.ShowDialog() == DialogResult.OK) { CustomTools.Tools[sel] = formEditTools.Tool; RefreshList(sel); } }
/// <summary> /// User clicked on the Add button to add a new tool. /// </summary> private void BtAddClick(object sender, EventArgs e) { FormEditTools formEditTools = new FormEditTools(new ClassTool()); if (formEditTools.ShowDialog() == DialogResult.OK) { int sel = listTools.SelectedIndex >= 0 ? listTools.SelectedIndex : 0; CustomTools.Tools.Insert(sel, formEditTools.Tool); RefreshList(sel); } }