private void PopulatePropList(PreviewBaseShape selectedShape = null) { comboBoxStringToEdit.Items.Clear(); foreach (PreviewBaseShape shape in Shape._strings) { Common.Controls.ComboBoxItem item = new Common.Controls.ComboBoxItem(shape.Name, shape); if (item.Text == null) { item.Text = shape.GetType().ToString(); item.Text = item.Text.Substring(item.Text.LastIndexOf('.') + 1); } comboBoxStringToEdit.Items.Add(item); } if (comboBoxStringToEdit.Items.Count > 0) { if (selectedShape != null) { foreach (Common.Controls.ComboBoxItem item in comboBoxStringToEdit.Items) { if ((item.Value as PreviewBaseShape) == selectedShape) { comboBoxStringToEdit.SelectedItem = item; return; } } } else { comboBoxStringToEdit.SelectedIndex = 0; } } }
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); } } } }
private void comboBoxShow_SelectedIndexChanged(object sender, EventArgs e) { Common.Controls.ComboBoxItem comboBoxItem = (sender as ComboBox).SelectedItem as Common.Controls.ComboBoxItem; Show item = comboBoxItem.Value as Show; _showItem.Show_ShowID = item.ID; _showItem.Name = "Start show: " + item.Name; FireChanged(_showItem.Name); }
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 comboBoxStringToEdit_SelectedIndexChanged(object sender, EventArgs e) { Common.Controls.ComboBoxItem item = comboBoxStringToEdit.SelectedItem as Common.Controls.ComboBoxItem; if (item != null) { PreviewBaseShape shape = item.Value as PreviewBaseShape; if (shape != null) { ShowSetupControl(shape); } } }
private void buttonOK_Click(object sender, EventArgs e) { if (connectStandardStrings && _shapes[0].StringType == PreviewBaseShape.StringTypes.Standard) { PreviewBaseShape shape = _shapes[0]; for (int i = 0; i < _shapes.Count; i++) { foreach (PreviewPixel pixel in _shapes[i]._pixels) { pixel.Node = _strings[0].Pixels[0].Node; pixel.NodeId = _strings[0].Pixels[0].NodeId; } } } else { // shapes with count==0 don't show up in combo box so keep separate index int comboidx = -1; for (int i = 0; i < _shapes.Count; i++) { //Console.WriteLine("i=" + i.ToString()); if (_shapes[i].Pixels.Count == 0) { continue; } comboidx++; Common.Controls.ComboBoxItem item = comboStrings.Items[comboidx] as Common.Controls.ComboBoxItem; PreviewSetElementString lightString = item.Value as PreviewSetElementString; PreviewBaseShape shape = _shapes[i]; for (int pixelNum = 0; pixelNum < lightString.Pixels.Count; pixelNum++) { //Console.WriteLine(" pixelNum=" + pixelNum.ToString()); // If this is a standard light string, assing ALL pixels to the first node if (shape.StringType == PreviewBaseShape.StringTypes.Standard) { foreach (PreviewPixel pixel in shape._pixels) { //Console.WriteLine(" pixel:" + lightString.Pixels[0].Node.Id.ToString()); pixel.Node = _strings[i].Pixels[0].Node; pixel.NodeId = _strings[i].Pixels[0].NodeId; } } else { shape.Pixels[pixelNum] = lightString.Pixels[pixelNum]; } } } } DialogResult = System.Windows.Forms.DialogResult.OK; Close(); }
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 void PopulateShowList() { foreach (Show show in _shows) { Common.Controls.ComboBoxItem item = new Common.Controls.ComboBoxItem(show.Name, show); if (show.ID != _currentShowID) { comboBoxShow.Items.Add(item); if (show.ID == _showItem.Show_ShowID) { comboBoxShow.SelectedItem = item; } } } }
private void btnSyncBulbSize_Click(object sender, EventArgs e) { Common.Controls.ComboBoxItem item = comboBoxStringToEdit.SelectedItem as Common.Controls.ComboBoxItem; if (item != null) { PreviewBaseShape shape = item.Value as PreviewBaseShape; if (shape != null) { var size = shape.PixelSize; foreach (PreviewBaseShape s in Shape._strings) { s.PixelSize = size; } } } }
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"); } } }
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); } } } }