private void configureCollectorToolStripMenuItem_Click(object sender, EventArgs e) { if (tvwCollectors.SelectedNode != null && tvwCollectors.SelectedNode.Tag != null && tvwCollectors.SelectedNode.Tag is CollectorEntry) { CollectorEntry collectorEntry = (CollectorEntry)tvwCollectors.SelectedNode.Tag; QuickMon.Management.EditCollectorEntry editCollectorEntry = new QuickMon.Management.EditCollectorEntry(); editCollectorEntry.AllowCollectorChange = false; editCollectorEntry.SelectedEntry = collectorEntry; if (editCollectorEntry.ShowDialog(monitorPack) == System.Windows.Forms.DialogResult.OK) { collectorEntry = editCollectorEntry.SelectedEntry; monitorPack.ApplyCollectorConfig(collectorEntry); tvwCollectors.SelectedNode.Tag = collectorEntry; tvwCollectors.SelectedNode.Text = collectorEntry.Name; if (!collectorEntry.Enabled) { if (!collectorEntry.IsFolder) { tvwCollectors.SelectedNode.ImageIndex = 1; tvwCollectors.SelectedNode.SelectedImageIndex = 1; } tvwCollectors.SelectedNode.ForeColor = Color.Gray; } else { tvwCollectors.SelectedNode.ForeColor = SystemColors.WindowText; if (!collectorEntry.IsFolder) { collectorEntry.RefreshDetailsIfOpen(); } } } } }