public SetupControllersSimple() { InitializeComponent(); buttonAddController.BackgroundImage = Resources.add; buttonAddController.Text = ""; buttonConfigureController.BackgroundImage = Resources.cog; buttonConfigureController.Text = ""; buttonNumberChannelsController.BackgroundImage = Resources.attributes_display; buttonNumberChannelsController.Text = ""; buttonRenameController.BackgroundImage = Resources.cog_edit; buttonRenameController.Text = ""; buttonDeleteController.BackgroundImage = Resources.delete; buttonDeleteController.Text = ""; comboBoxNewControllerType.BeginUpdate(); foreach (KeyValuePair<Guid, string> kvp in ApplicationServices.GetAvailableModules<IControllerModuleInstance>()) { ComboBoxItem item = new ComboBoxItem(kvp.Value, kvp.Key); comboBoxNewControllerType.Items.Add(item); } comboBoxNewControllerType.EndUpdate(); if (comboBoxNewControllerType.Items.Count > 0) comboBoxNewControllerType.SelectedIndex = 0; controllerTree.ControllerSelectionChanged += controllerTree_ControllerSelectionChanged; controllerTree.ControllersChanged += controllerTree_ControllersChanged; UpdateButtons(); }
private void UpdateListLinkedElements() { listLinkedElements.Items.Clear(); Common.Controls.ComboBoxItem comboBoxItem = comboStrings.SelectedItem as Common.Controls.ComboBoxItem; if (comboBoxItem != null) { PreviewSetElementString elementString = comboBoxItem.Value as PreviewSetElementString; if (elementString != null) { foreach (PreviewPixel pixel in elementString.Pixels) { ListViewItem item = new ListViewItem((listLinkedElements.Items.Count + 1).ToString()); item.Tag = pixel; listLinkedElements.Items.Add(item); SetLinkedElementItems(item, pixel.Node); } } else { Console.WriteLine("elementString==null"); } var count = elementString.Pixels.Count(); numericUpDownLightCount.Value = count > 0?count:1; AdjustColumnWidths(); } }
private void PopulateShowList() { List <Shows.Show> shows = Shows.ShowsData.ShowList; if (shows != null) { foreach (Shows.Show show in shows) { bool foundIt = false; foreach (Common.Controls.ComboBoxItem oldItem in comboBoxShows.Items) { Shows.Show comboBoxScheduleItem = oldItem.Value as Shows.Show; if (comboBoxScheduleItem.ID == show.ID) { oldItem.Text = show.Name; foundIt = true; break; } } if (!foundIt) { Common.Controls.ComboBoxItem newItem = new Common.Controls.ComboBoxItem(show.Name, show); comboBoxShows.Items.Add(newItem); } } } }
public SetupElementsTree(IEnumerable<IElementTemplate> elementTemplates, IEnumerable<IElementSetupHelper> elementSetupHelpers) { InitializeComponent(); buttonAddTemplate.BackgroundImage = Resources.add; buttonAddTemplate.Text = ""; buttonRunHelperSetup.BackgroundImage = Resources.cog_go; buttonRunHelperSetup.Text = ""; buttonAddProperty.BackgroundImage = Resources.add; buttonAddProperty.Text = ""; buttonRemoveProperty.BackgroundImage = Resources.delete; buttonRemoveProperty.Text = ""; buttonConfigureProperty.BackgroundImage = Resources.cog; buttonConfigureProperty.Text = ""; comboBoxNewItemType.BeginUpdate(); foreach (IElementTemplate template in elementTemplates) { ComboBoxItem item = new ComboBoxItem(template.TemplateName, template); comboBoxNewItemType.Items.Add(item); } comboBoxNewItemType.EndUpdate(); if (comboBoxNewItemType.Items.Count > 0) comboBoxNewItemType.SelectedIndex = 0; comboBoxSetupHelperType.BeginUpdate(); foreach (IElementSetupHelper helper in elementSetupHelpers) { ComboBoxItem item = new ComboBoxItem(helper.HelperName, helper); comboBoxSetupHelperType.Items.Add(item); } comboBoxSetupHelperType.EndUpdate(); if (comboBoxSetupHelperType.Items.Count > 0) comboBoxSetupHelperType.SelectedIndex = 0; UpdateFormWithNode(null); }
public void PopulateShowList(Guid showID) { foreach (Shows.Show show in Shows.ShowsData.ShowList) { Common.Controls.ComboBoxItem item = new Common.Controls.ComboBoxItem(show.Name, show); comboBoxShow.Items.Add(item); if (show.ID == showID) { comboBoxShow.SelectedItem = item; } } }
private void buttonPlayShowNow_Click(object sender, EventArgs e) { Common.Controls.ComboBoxItem item = comboBoxShows.SelectedItem as Common.Controls.ComboBoxItem; if (item != null) { Shows.Show show = item.Value as Shows.Show; Executor.Stop(false); ScheduleItem scheduleItem = new ScheduleItem(); scheduleItem.ShowID = show.ID; scheduleItem.Start(true); } }
public SetupElementsTree(IEnumerable<IElementTemplate> elementTemplates, IEnumerable<IElementSetupHelper> elementSetupHelpers) { InitializeComponent(); int iconSize = (int)(24 * ScalingTools.GetScaleFactor()); buttonAddTemplate.Image = Tools.GetIcon(Resources.add, iconSize); buttonAddTemplate.Text = ""; buttonRunHelperSetup.Image = Tools.GetIcon(Resources.cog_go, iconSize); buttonRunHelperSetup.Text = ""; buttonAddProperty.Image = Tools.GetIcon(Resources.add, iconSize); buttonAddProperty.Text = ""; buttonRemoveProperty.Image = Tools.GetIcon(Resources.delete, iconSize); buttonRemoveProperty.Text = ""; buttonConfigureProperty.Image = Tools.GetIcon(Resources.cog, iconSize); buttonConfigureProperty.Text = ""; buttonDeleteElements.Image = Tools.GetIcon(Resources.delete, iconSize); buttonDeleteElements.Text = ""; buttonRenameElements.Image = Tools.GetIcon(Resources.pencil, iconSize); buttonRenameElements.Text = ""; buttonSelectDestinationOutputs.Image = Tools.GetIcon(Resources.table_select_row, iconSize); buttonSelectDestinationOutputs.Text = ""; ForeColor = ThemeColorTable.ForeColor; BackColor = ThemeColorTable.BackgroundColor; ThemeUpdateControls.UpdateControls(this); // comboBoxNewItemType.BackColor = ThemeColorTable.BackgroundColor; // comboBoxSetupHelperType.BackColor = ThemeColorTable.BackgroundColor; comboBoxNewItemType.BeginUpdate(); foreach (IElementTemplate template in elementTemplates) { ComboBoxItem item = new ComboBoxItem(template.TemplateName, template); comboBoxNewItemType.Items.Add(item); } comboBoxNewItemType.EndUpdate(); if (comboBoxNewItemType.Items.Count > 0) comboBoxNewItemType.SelectedIndex = 0; comboBoxSetupHelperType.BeginUpdate(); foreach (IElementSetupHelper helper in elementSetupHelpers) { ComboBoxItem item = new ComboBoxItem(helper.HelperName, helper); comboBoxSetupHelperType.Items.Add(item); } comboBoxSetupHelperType.EndUpdate(); if (comboBoxSetupHelperType.Items.Count > 0) comboBoxSetupHelperType.SelectedIndex = 0; UpdateFormWithNode(null); }
public SetupElementsTree(IEnumerable<IElementTemplate> elementTemplates, IEnumerable<IElementSetupHelper> elementSetupHelpers) { InitializeComponent(); buttonAddTemplate.Image = Tools.GetIcon(Resources.add, 16); buttonAddTemplate.Text = ""; buttonRunHelperSetup.Image = Tools.GetIcon(Resources.cog_go, 16); buttonRunHelperSetup.Text = ""; buttonAddProperty.Image = Tools.GetIcon(Resources.add, 16); buttonAddProperty.Text = ""; buttonRemoveProperty.Image = Tools.GetIcon(Resources.delete, 16); buttonRemoveProperty.Text = ""; buttonConfigureProperty.Image = Tools.GetIcon(Resources.cog, 16); buttonConfigureProperty.Text = ""; buttonDeleteElements.Image = Tools.GetIcon(Resources.delete, 16); buttonDeleteElements.Text = ""; buttonRenameElements.Image = Tools.GetIcon(Resources.pencil, 16); buttonRenameElements.Text = ""; buttonSelectDestinationOutputs.Image = Tools.GetIcon(Resources.table_select_row, 16); buttonSelectDestinationOutputs.Text = ""; comboBoxNewItemType.BeginUpdate(); foreach (IElementTemplate template in elementTemplates) { ComboBoxItem item = new ComboBoxItem(template.TemplateName, template); comboBoxNewItemType.Items.Add(item); } comboBoxNewItemType.EndUpdate(); if (comboBoxNewItemType.Items.Count > 0) comboBoxNewItemType.SelectedIndex = 0; comboBoxSetupHelperType.BeginUpdate(); foreach (IElementSetupHelper helper in elementSetupHelpers) { ComboBoxItem item = new ComboBoxItem(helper.HelperName, helper); comboBoxSetupHelperType.Items.Add(item); } comboBoxSetupHelperType.EndUpdate(); if (comboBoxSetupHelperType.Items.Count > 0) comboBoxSetupHelperType.SelectedIndex = 0; UpdateFormWithNode(null); }
private void buttonSetLightCount_Click(object sender, EventArgs e) { Common.Controls.ComboBoxItem comboBoxItem = comboStrings.SelectedItem as Common.Controls.ComboBoxItem; if (comboBoxItem != null) { PreviewSetElementString elementString = comboBoxItem.Value as PreviewSetElementString; if (elementString != null) { while (elementString.Pixels.Count > numericUpDownLightCount.Value) { elementString.Pixels.RemoveAt(elementString.Pixels.Count - 1); } while (elementString.Pixels.Count < numericUpDownLightCount.Value) { PreviewPixel pixel = new PreviewPixel(); elementString.Pixels.Add(pixel); } } UpdateListLinkedElements(); } }
public SetupControllersSimple() { InitializeComponent(); int iconSize = (int)(24 * ScalingTools.GetScaleFactor()); buttonAddController.Image = Tools.GetIcon(Resources.add, iconSize); buttonAddController.Text = ""; buttonConfigureController.Image = Tools.GetIcon(Resources.cog, iconSize); buttonConfigureController.Text = ""; buttonNumberChannelsController.Image = Tools.GetIcon(Resources.attributes_display, iconSize); buttonNumberChannelsController.Text = ""; buttonRenameController.Image = Tools.GetIcon(Resources.pencil, iconSize); buttonRenameController.Text = ""; buttonDeleteController.Image = Tools.GetIcon(Resources.delete, iconSize); buttonDeleteController.Text = ""; buttonSelectSourceElements.Image = Tools.GetIcon(Resources.table_select_row, iconSize); buttonSelectSourceElements.Text = ""; buttonStopController.Image = Tools.GetIcon(Resources.control_stop_blue, iconSize); buttonStopController.Text = ""; buttonStartController.Image = Tools.GetIcon(Resources.control_play_blue, iconSize); buttonStartController.Text = ""; ForeColor = ThemeColorTable.ForeColor; BackColor = ThemeColorTable.BackgroundColor; ThemeUpdateControls.UpdateControls(this); comboBoxNewControllerType.BeginUpdate(); foreach (KeyValuePair<Guid, string> kvp in ApplicationServices.GetAvailableModules<IControllerModuleInstance>()) { ComboBoxItem item = new ComboBoxItem(kvp.Value, kvp.Key); comboBoxNewControllerType.Items.Add(item); } comboBoxNewControllerType.EndUpdate(); comboBoxNewControllerType.Sorted = true; if (comboBoxNewControllerType.Items.Count > 0) comboBoxNewControllerType.SelectedIndex = 0; controllerTree.ControllerSelectionChanged += controllerTree_ControllerSelectionChanged; controllerTree.ControllersChanged += controllerTree_ControllersChanged; UpdateForm(); }
private void PopulateShowList() { List<Shows.Show> shows = Shows.ShowsData.ShowList; if (shows != null) { foreach (Shows.Show show in shows) { bool foundIt = false; foreach (Common.Controls.ComboBoxItem oldItem in comboBoxShows.Items) { Shows.Show comboBoxScheduleItem = oldItem.Value as Shows.Show; if (comboBoxScheduleItem.ID == show.ID) { oldItem.Text = show.Name; foundIt = true; break; } } if (!foundIt) { Common.Controls.ComboBoxItem newItem = new Common.Controls.ComboBoxItem(show.Name, show); comboBoxShows.Items.Add(newItem); } } } }