private void levelComboBox_SelectedIndexChanged(object sender, EventArgs e) { if (!ignoreChanges) { ComboBoxWithDefault combo = sender as ComboBoxWithDefault; ReflectionHelpers.SetFieldOrProperty( eventUnit, combo.Tag.ToString(), (byte)(combo.SelectedIndex > 199 ? 254 : combo.SelectedIndex)); OnDataChanged(this, EventArgs.Empty); } }
private void UpdateBonusCashDict(ComboBoxWithDefault sender, TupleDictionary <PropositionType, BonusPercent, BonusIndex> dict) { string changed = sender.Tag.ToString(); string[] sides = changed.Split('.'); string errandType = sides[0]; string percentage = sides[1]; BonusPercent percent = (BonusPercent)Enum.Parse(typeof(BonusPercent), percentage); PropositionType type = (PropositionType)Enum.Parse(typeof(PropositionType), errandType); dict[type, percent] = (BonusIndex)(sender.SelectedIndex); }