private void deleteToolStripMenuItem_Click(object sender, EventArgs e) { if (checkLB.SelectedItems.Count > 0) { TK.BaseLib.Checking.Check targetCheck = checkLB.SelectedItems[0] as TK.BaseLib.Checking.Check; _loadedList.Checks.Remove(targetCheck); UpdateLB(); } }
private void duplicateToolStripMenuItem_Click(object sender, EventArgs e) { if (checkLB.SelectedItems.Count > 0) { TK.BaseLib.Checking.Check targetCheck = checkLB.SelectedItems[0] as TK.BaseLib.Checking.Check; TK.BaseLib.Checking.Check newCheck = new TK.BaseLib.Checking.Check(); newCheck.Copy(targetCheck); _loadedList.Checks.Add(newCheck); UpdateLB(); } }
private void moveDownToolStripMenuItem_Click(object sender, EventArgs e) { if (checkLB.SelectedItems.Count > 0) { TK.BaseLib.Checking.Check targetCheck = checkLB.SelectedItems[0] as TK.BaseLib.Checking.Check; int idx = _loadedList.Checks.IndexOf(targetCheck); if (idx < _loadedList.Checks.Count - 1) { _loadedList.Checks.Remove(targetCheck); _loadedList.Checks.Insert(idx + 1, targetCheck); UpdateLB(); } } }