private void ShowDecoder() { _populatingData = true; SetInfoTextBoxes(); DCSBIOSDecoder.ShowOnly(_dcsbiosDecoder, _streamDeckPanel); if (_dcsbiosDecoder.DecoderSourceType == DCSBiosOutputType.INTEGER_TYPE) { RadioButtonIntegerSource.IsChecked = true; } else if (_dcsbiosDecoder.DecoderSourceType == DCSBiosOutputType.STRING_TYPE) { RadioButtonStringSource.IsChecked = true; } switch (_dcsbiosDecoder.DecoderOutputType) { case EnumDCSBIOSDecoderOutputType.Raw: { TextBoxOutputTextRaw.Text = _dcsbiosDecoder.ButtonTextTemplate; RadioButtonProcessToRaw.IsChecked = true; break; } case EnumDCSBIOSDecoderOutputType.Converter: { RadioButtonProcessToConverter.IsChecked = true; break; } } CheckBoxTreatStringAsNumber.IsChecked = _dcsbiosDecoder.TreatStringAsNumber; CheckBoxUseFormula.IsChecked = _dcsbiosDecoder.UseFormula; if (_dcsbiosDecoder.UseFormula) { CheckBoxUseFormula.IsChecked = true; TextBoxFormula.Text = string.IsNullOrEmpty(_dcsbiosDecoder.Formula) ? "" : _dcsbiosDecoder.Formula; } if (_dcsbiosDecoder.DCSBIOSOutput != null) { TextBoxDCSBIOSId.Text = _dcsbiosDecoder.DCSBIOSOutput.ControlId; } ShowConverters(); TextBoxFontInfo.UpdateFontInfo(); _populatingData = false; }
private void ShowDecoder() { _populatingData = true; SetInfoTextBoxes(); DCSBIOSDecoder.ShowOnly(_dcsbiosDecoder, _streamDeckPanel); if (_dcsbiosDecoder.DecoderSourceType == DCSBiosOutputType.IntegerType) { RadioButtonIntegerSource.IsChecked = true; } else if (_dcsbiosDecoder.DecoderSourceType == DCSBiosOutputType.StringType) { RadioButtonStringSource.IsChecked = true; } switch (_dcsbiosDecoder.DecoderOutputType) { case EnumDCSBIOSDecoderOutputType.Raw: { TextBoxOutputTextRaw.Text = _dcsbiosDecoder.ButtonTextTemplate; RadioButtonProcessToRaw.IsChecked = true; break; } case EnumDCSBIOSDecoderOutputType.Converter: { RadioButtonProcessToConverter.IsChecked = true; break; } } CheckBoxTreatStringAsNumber.IsChecked = _dcsbiosDecoder.TreatStringAsNumber; CheckBoxUseFormula.IsChecked = _dcsbiosDecoder.UseFormula; if (_dcsbiosDecoder.UseFormula && _dcsbiosDecoder.FormulaInstance != null) { CheckBoxUseFormula.IsChecked = true; TextBoxFormula.Text = string.IsNullOrEmpty(_dcsbiosDecoder.FormulaInstance.Formula) ? string.Empty : _dcsbiosDecoder.FormulaInstance.Formula; if (_dcsbiosDecoder.LimitDecimalPlaces && _dcsbiosDecoder.NumberFormatInfoFormula != null) { CheckBoxLimitDecimals.Checked -= CheckBoxLimitDecimals_CheckedChanged; CheckBoxLimitDecimals.Unchecked -= CheckBoxLimitDecimals_CheckedChanged; CheckBoxLimitDecimals.IsChecked = _dcsbiosDecoder.LimitDecimalPlaces; CheckBoxLimitDecimals.Checked += CheckBoxLimitDecimals_CheckedChanged; CheckBoxLimitDecimals.Unchecked += CheckBoxLimitDecimals_CheckedChanged; ComboBoxDecimals.SelectionChanged -= ComboBoxDecimals_OnSelectionChanged; ComboBoxDecimals.SelectedIndex = _dcsbiosDecoder.NumberFormatInfoFormula.NumberDecimalDigits; ComboBoxDecimals.SelectionChanged += ComboBoxDecimals_OnSelectionChanged; } } if (_dcsbiosDecoder.DCSBIOSOutput != null) { TextBoxDCSBIOSId.Text = _dcsbiosDecoder.DCSBIOSOutput.ControlId; } ShowConverters(); TextBoxFontInfo.UpdateFontInfo(); _populatingData = false; }