private void combo_producer(object sender, EventArgs e) { if (ignoreTimerEvents) { return; } ignoreTimerEvents = true; if (producerComboBoxToolItem.SelectedItem != null) { PluginItem plugin = (PluginItem)producerComboBoxToolItem.SelectedItem; manager.ActivateProducer(plugin.Guid); } else { manager.ActivateProducer(new Guid()); } updatePanel(); ignoreTimerEvents = false; }
private void pluginListView_ItemCheck(object sender, ItemCheckEventArgs e) { // Ignore automatic checks if (ignoreChecks) { return; } ignoreChecks = true; // Producer has changed if (pluginListView.Items[e.Index].Group == producerGroup) { // Prevent from uncheck if (e.NewValue == CheckState.Unchecked) { e.NewValue = CheckState.Checked; } else { foreach (ListViewItem item in pluginListView.Items) { if (item.Index != e.Index && item.Group == producerGroup) { item.Checked = false; } } PluginItem plugin = (PluginItem)pluginListView.Items[e.Index].Tag; manager.ActivateProducer(plugin.Guid); } } // Consumer has changed if (pluginListView.Items[e.Index].Group == consumerGroup) { PluginItem plugin = (PluginItem)pluginListView.Items[e.Index].Tag; if (e.NewValue == CheckState.Checked) { // Activate manager.ActivateConsumer(plugin.Guid); } else { // Deactivate manager.DeactivateConsumer(plugin.Guid); } } ignoreChecks = false; }
private void button_producer(object sender, EventArgs e) { if (ignoreTimerEvents) { return; } ignoreTimerEvents = true; ToolStripMenuItem menuItem = sender as ToolStripMenuItem; PluginItem plugin = menuItem.Tag as PluginItem; manager.ActivateProducer(plugin.Guid); updatePanel(); ignoreTimerEvents = false; }