public void DeleteTask(object sender, EventArgs e) { if (mainTModel.Table.SelectedIndicies.Length == 0) { return; } List <int[]> tasks = this.GetTasks(this.FilterType); Helper.DeleteTask(tasks[mainTModel.Table.SelectedIndicies[0]][0], tasks[mainTModel.Table.SelectedIndicies[0]][1]); }
public void DeleteTask(object sender, EventArgs e) { if (mainTasksTreeView.SelectedNode.Parent == null) { return; } List <int[]> tasks = this.GetTreeTasks(); // Shift int shift = 0; for (int i = 0; i < mainTasksTreeView.SelectedNode.Parent.Index; i++) { shift += mainTasksTreeView.Nodes[i].Nodes.Count; } Helper.DeleteTask(tasks[shift + mainTasksTreeView.SelectedNode.Index][0], tasks[shift + mainTasksTreeView.SelectedNode.Index][1]); }