private void listView1_Click(object sender, EventArgs e) { if (listView1.SelectedItems.Count == 0) { return; } FormTask.StartTask((Task)listView1.SelectedItems[0].Tag, settings); Hide(); }
private void MenuItem_Click(object sender, EventArgs e) { if (!(sender is ToolStripMenuItem)) { return; } ToolStripMenuItem item = (ToolStripMenuItem)sender; if (item.Tag == null) { return; } if (!(item.Tag is Task)) { return; } FormTask.StartTask((Task)item.Tag, applicationManager.Settings); }