//OKボタン private void button3_Click(object sender, EventArgs e) { if (!initialAvailableTransRule_.All(tr => tr == textBox1.Text || listBox1.Items.Contains(tr))) { DialogResult res = MessageBox.Show("変換キーが削除されています。削除された変換キーは二度と復元できませんが、よろしいですか?", "設定保存確認", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2); if (res == DialogResult.No) { this.DialogResult = DialogResult.None; return; } } if (!listBox1.Items.Contains(textBox1.Text)) { MessageBox.Show("選択されている変換キーが候補一覧に含まれていません。候補一覧に追加します。", "設定保存確認"); listBox1.Items.Add(textBox1.Text); } sd_ = new SettingData(); foreach (string str in listBox1.Items) { sd_.encryptStrings.Add(str); } sd_.selectedEnc = textBox1.Text; sd_.encryptId = checkBox1.Checked; sd_.ambiguousBirthDate = checkBox2.Checked; sd_.ambiguousPostalCode = checkBox3.Checked; sd_.birthDateModifyType = BirthDateModifier.getTypeNum(comboBox1.Text); sd_.postalCodeModifyType = PostalCodeModifier.getTypeNum(comboBox2.Text); sd_.serialize(); }
public SettingDialog() { InitializeComponent(); SettingData sd = SettingData.load(); if (sd.encryptStrings != null) { sd.encryptStrings.ForEach(es => listBox1.Items.Add(es)); } if (sd.selectedEnc != null) { textBox1.Text = sd.selectedEnc; } checkBox1.Checked = sd.encryptId; checkBox2.Checked = sd.ambiguousBirthDate; checkBox3.Checked = sd.ambiguousPostalCode; string[] bddes = BirthDateModifier.descriptions(); comboBox1.Items.AddRange(bddes); comboBox1.Text = (BirthDateModifier.TypedConstructor(sd.birthDateModifyType)).ToString(); string[] cpdes = PostalCodeModifier.descriptions(); comboBox2.Items.AddRange(cpdes); comboBox2.Text = (PostalCodeModifier.TypedConstructor(sd.postalCodeModifyType)).ToString(); if (textBox1.Text != "") { initialAvailableTransRule_.Add(textBox1.Text); } foreach (string str in listBox1.Items) { initialAvailableTransRule_.Add(str); } }
public Form1() { InitializeComponent(); SettingData sd = SettingData.load(); types_ = sd.types; encrypt = IdEncryption.StringConstructor(sd.selectedEnc); encryptId = sd.encryptId; ambiguousBirthDate = sd.ambiguousBirthDate; ambiguousPostalCode = sd.ambiguousPostalCode; bdmod = BirthDateModifier.TypedConstructor(sd.birthDateModifyType); pcmod = PostalCodeModifier.TypedConstructor(sd.postalCodeModifyType); if (encrypt.isBlank()) { button5_Click(null, null); } }
private void button4_Click(object sender, EventArgs e) { TypeSet ts = new TypeSet(); ts.initialize(); DialogResult tsRes = ts.ShowDialog(); string ftname = ts.selectedFileTypeName(); if (tsRes == DialogResult.Cancel || ftname == null) { ts.Dispose(); return; } ts.Dispose(); SettingData sd = SettingData.load(); this.types_ = sd.types; FileType selft = this.types_[ftname]; for (int i = listBox1.Items.Count - 1; i >= 0; i--) { if (listBox1.GetSelected(i)) { setTypeToList(selft, i); } //選ばれてたtypesが消されてたときの処理 string tn = getTypeNameFromList(listBox1.Items[i].ToString()); if (!this.types_.ContainsKey(tn)) { setTypeToList(null, i); } } listBox1.ClearSelected(); displayProcessableFiles(); }
public void initialize() { sd_ = SettingData.load(); sd_.types.Keys.ToList().ForEach(ftn => listBox1.Items.Add(ftn)); tboxs = new TextBox[] { textBox1, textBox2, textBox3, textBox4, textBox5, textBox6, textBox7, textBox8, textBox9, textBox10 }; }