private void RevealSubtypesDropDownOverPanel(string message, ComplexTypeStruct typeStruct) { ClearOverPanel(); m_currentOverPanelMode = EOverPanelViewMode.MultiDropDownOption; textLabel.Text = message; SubTypeStruct[] allSubTypes = StoringSubTypeElement.getEntryList(); SubTypeStruct[] allCatSubTypes = Array.FindAll(allSubTypes, x => x.typeBelongsTo.Contains(typeStruct.type)); foreach (dynamic catSub in allCatSubTypes) { overOptionsListbox.Items.Add(catSub.name); } overOptionsListbox.Height = LISTBOXITEMHEIGHT * (overOptionsListbox.Items.Count <= LISTBOXITEMMAXELEMENTS ? overOptionsListbox.Items.Count : LISTBOXITEMMAXELEMENTS); overOptionsListbox.EndUpdate(); overOptionsListbox.SelectionMode = SelectionMode.MultiSimple; foreach (dynamic subTypeID in typeStruct.subTypes) { dynamic subtype = Array.Find(allCatSubTypes, x => x.id == subTypeID); dynamic indexSubType = overOptionsListbox.FindString(subtype.name); overOptionsListbox.SetSelected(indexSubType, true); } overPanel.Show(); }
private void onListboxClick(object sender, EventArgs e) { switch (m_currentActivePanel) { case EDropDownTextListPanel.Colour: m_cardEntry.colourSet.Clear(); foreach (dynamic colour in colourListbox.SelectedItems) { m_cardEntry.colourSet.Add(colour); } colourBox.Text = m_cardEntry.printColourSet(); break; case EDropDownTextListPanel.Language: m_cardEntry.language = (ELanguage)languageListbox.SelectedItem; languageBox.Text = m_cardEntry.printLanguage(); HidePanels(); break; case EDropDownTextListPanel.Rarity: m_cardEntry.rarity = ENumConverters.getERarityStr(rarityListbox.SelectedItem.ToString()); rarityBox.Text = m_cardEntry.printRarity(); HidePanels(); break; case EDropDownTextListPanel.CardVariation: m_cardEntry.variation.Clear(); foreach (dynamic variation in cardVariationListbox.SelectedItems) { m_cardEntry.variation.Add(ENumConverters.getEVariationStr(variation)); } cardVariationBox.Text = m_cardEntry.printCardVariation(); break; case EDropDownTextListPanel.Types: m_cardEntry.types.Clear(); if (clickCallPopUpDelegate != null) { clickCallPopUpDelegate(EPopUpSourceCalled.Type); } else { foreach (dynamic type in typesListbox.SelectedItems) { dynamic typeStruct = new ComplexTypeStruct(); typeStruct.ClearComplexType(ENumConverters.getETypeStr(type)); m_cardEntry.types.Add(typeStruct); } } typeBox.Text = m_cardEntry.printTypes(StoringSubTypeElement.getEntryList().ToList()); break; case EDropDownTextListPanel.Edition: getlist m_cardEntry.editionID break; } }