private void RefreshConsumerPanel() { if (lastConsumer != listBox2.SelectedItem) { this.panelOutput.Controls.Clear(); if (consumerEditorControl != null) { consumerEditorControl.Dispose(); } this.consumerEditorControl = null; if (listBox2.SelectedItems.Count > 0) { if (listBox2.SelectedItem.GetType() == typeof(DecklinkConsumer)) { this.consumerEditorControl = new DecklinkConsumerControl(listBox2.SelectedItem as DecklinkConsumer, config.AvailableDecklinkIDs); this.panelOutput.Controls.Add(consumerEditorControl); } else if (listBox2.SelectedItem.GetType() == typeof(ScreenConsumer)) { this.consumerEditorControl = new ScreenConsumerControl(listBox2.SelectedItem as ScreenConsumer); this.panelOutput.Controls.Add(consumerEditorControl); } else if (listBox2.SelectedItem.GetType() == typeof(BluefishConsumer)) { this.consumerEditorControl = new BluefishConsumerControl(listBox2.SelectedItem as BluefishConsumer, config.AvailableBluefishIDs); this.panelOutput.Controls.Add(consumerEditorControl); } } } lastConsumer = (AbstractConsumer)listBox2.SelectedItem; }
private void RefreshConsumerPanel() { if (lastConsumer != listBox2.SelectedItem) { this.panelOutput.Controls.Clear(); if (consumerEditorControl != null) consumerEditorControl.Dispose(); this.consumerEditorControl = null; if (listBox2.SelectedItems.Count > 0) { if (listBox2.SelectedItem.GetType() == typeof(DecklinkConsumer)) { this.consumerEditorControl = new DecklinkConsumerControl(listBox2.SelectedItem as DecklinkConsumer,config.AvailableDecklinkIDs); this.panelOutput.Controls.Add(consumerEditorControl); } else if (listBox2.SelectedItem.GetType() == typeof(ScreenConsumer)) { this.consumerEditorControl = new ScreenConsumerControl(listBox2.SelectedItem as ScreenConsumer); this.panelOutput.Controls.Add(consumerEditorControl); } else if (listBox2.SelectedItem.GetType() == typeof(BluefishConsumer)) { this.consumerEditorControl = new BluefishConsumerControl(listBox2.SelectedItem as BluefishConsumer, config.AvailableBluefishIDs); this.panelOutput.Controls.Add(consumerEditorControl); } else if (listBox2.SelectedItem.GetType() == typeof(StreamConsumer)) { this.consumerEditorControl = new StreamConsumerControl(listBox2.SelectedItem as StreamConsumer); this.panelOutput.Controls.Add(consumerEditorControl); } else if (listBox2.SelectedItem.GetType() == typeof(NewTekIVGAConsumer)) { this.consumerEditorControl = new NewTekIVGAConsumerControl(listBox2.SelectedItem as NewTekIVGAConsumer); this.panelOutput.Controls.Add(consumerEditorControl); } } } lastConsumer = (AbstractConsumer)listBox2.SelectedItem; }