private void usuñZadanieToolStripMenuItem_Click(object sender, EventArgs e) { listView.Items.Clear(); scheduler.Clear(); labelOpis.Text = ""; if (configuration != null) { configuration.Dispose(); configuration = null; listView.Items.Remove(listItem); listItem = null; } }
private void dodajZadanieToolStripMenuItem_Click(object sender, EventArgs e) { configuration = new PasswordTaskConfigurationForm(); if (configuration.ShowDialog(this) != DialogResult.OK) { return; } if (server == null) { startToolStripMenuItem.Enabled = true; toolStripButtonUruchom.Enabled = true; } TaskManager manager = new TaskManager(); manager.Dispatcher = configuration.GetDispatcher(); manager.Mode = configuration.GetMode(); scheduler.Add(manager); listItem = new ListViewItem(manager.GetHashCode().ToString()); listItem.Tag = manager; itemZadania = new ListViewItem.ListViewSubItem(listItem, "0"); itemAktywne = new ListViewItem.ListViewSubItem(listItem, "0"); itemWykonane = new ListViewItem.ListViewSubItem(listItem, "0"); itemProcent = new ListViewItem.ListViewSubItem(listItem, "0"); itemSzybkosc = new ListViewItem.ListViewSubItem(listItem, "0"); itemStatus = new ListViewItem.ListViewSubItem(listItem, ""); itemMode = new ListViewItem.ListViewSubItem(listItem, manager.Mode.ToString()); listItem.SubItems.Add(itemZadania); listItem.SubItems.Add(itemAktywne); listItem.SubItems.Add(itemWykonane); listItem.SubItems.Add(itemProcent); listItem.SubItems.Add(itemSzybkosc); listItem.SubItems.Add(itemStatus); listItem.SubItems.Add(itemMode); listView.Items.Add(listItem); configuration = null; UpdateListView("..."); }