public void applyChange(DecodeSettings.Change changeType, object value) { switch (changeType) { case DecodeSettings.Change.DecoderType: setShowDecode(); break; case DecodeSettings.Change.ShowDirection: dataGridCards_ChangeVisible(cardGridColumn.DIRECTION_COLUMN, (bool)value); break; case DecodeSettings.Change.ShowTime: dataGridCards_ChangeVisible(cardGridColumn.TIME_COLUMN, (bool)value); break; case DecodeSettings.Change.ShowTrack: dataGridCards_ChangeVisible(cardGridColumn.TRACK1_COLUMN + (int)value, settingsWindow.getShowTrack((int)value)); break; case DecodeSettings.Change.TimeFormat: decodeSettingComboxSelectChanged(ComboxSelect.TimeFormat, (int)value); break; case DecodeSettings.Change.DecodeMethod: decodeSettingComboxSelectChanged(ComboxSelect.DecodeMethod, (int)value); break; case DecodeSettings.Change.TrackBPC: decodeSettingComboxSelectChanged(ComboxSelect.TrackBPC, (int)value); break; case DecodeSettings.Change.AlignChars: _decodeForm.CommonSubstringChars.Text = (string)value; ListCardUtil.SetGroupCards(_decodeForm.CardsGrid.GetActualCardsFromGrid(), 0); ListCardUtil.SetAlignment(_decodeForm.CardsGrid.GetActualCardsFromGrid(), 0); _decodeForm.gridRefresh(); // _decodeForm.CardsGrid.Refresh(); _decodeForm.UpdateTxtBox(); break; case DecodeSettings.Change.GroupSwipes: _decodeForm.MsGroupCards.Text = ((int)value).ToString(); ListCardUtil.SetGroupCards(_decodeForm.CardsGrid.GetActualCardsFromGrid(), 0); ListCardUtil.SetAlignment(_decodeForm.CardsGrid.GetActualCardsFromGrid(), 0); _decodeForm.gridRefresh(); //_decodeForm.CardsGrid.Refresh(); _decodeForm.UpdateTxtBox(); break; case DecodeSettings.Change.SettingsClosed: settingsWindow = null; break; } }
public void showDecodeSetting(bool firstTime) { IList <Card> cards = _decodeForm.CardsGrid.GetCardsFromGrid(); setVariantsGridDataSource(null); _decodeForm.CardsGrid.CurrentCell = null; if ((cards == null) || (cards.Count == 0)) { MessageBox.Show(_decodeForm.DecodeForm, "No cards in file. Check that you have written correct password.", "Decode", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (!firstTime) { string advancedDecoderWarning = "By changing any setting in this window, you will loose any changes that you have made manually. Please make sure that you've saved your data before continuing."; if (!Settings.Default.showAdvancedDecoder && Settings.Default.showDecoderSwitchWarning) { DialogResult r = TaskDialog.MessageBox(_decodeForm.DecodeForm, "Warning", "Are you sure that you want to continue?", advancedDecoderWarning, "Don't show this message again for this document", TaskDialogButtons.YesNo, SysIcons.Warning); Settings.Default.showDecoderSwitchWarning = !TaskDialog.VerificationChecked; if (r == DialogResult.No) { return; } } } int t1, t2, t3; findTracksWithInfo(cards, out t1, out t2, out t3); settingsWindow = new DecodeSettings(t1, t2, t3, cards.Count); settingsWindow.applyChange += applyChange; settingsWindow.Show(_decodeForm); }
public DecodeSettingsTrack(ref CheckBox s, ref ComboBox b, ref TextBox st, bool sShow, int sBpc, int sStart, DecodeSettings p, int t) { trackNumber = t; showCheckBox = s; bpcComboBox = b; startTextBox = st; parent = p; lastValue = (byte)sStart; showCheckBox.Checked = sShow; bpcComboBox.SelectedIndex = bpcComboBox.FindStringExact(sBpc.ToString()); startTextBox.Text = "0x" + sStart.ToString("x"); updateBoxes(); showCheckBox.CheckedChanged += new System.EventHandler(this.showTrack_CheckedChanged); bpcComboBox.SelectedIndexChanged += new System.EventHandler(this.BPCChanged); startTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.startValidating); }