Example #1
0
        //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();
        }
Example #2
0
        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);
            }
        }
Example #3
0
        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);
            }
        }
Example #4
0
        private void button5_Click(object sender, EventArgs e)
        {
            SettingDialog sd = new SettingDialog();

            DialogResult sdRes = sd.ShowDialog();

            if (sdRes == DialogResult.Cancel)
            {
                sd.Dispose();
                return;
            }

            string encryptString = sd.getEncryptionString();

            encrypt            = IdEncryption.StringConstructor(encryptString);
            encryptId          = sd.getEncryptId();
            ambiguousBirthDate = sd.getAmbiguousBirthDate();
            bdmod = BirthDateModifier.TypedConstructor(sd.getBirthDateModifyType());
            ambiguousPostalCode = sd.getAmbiguousPostalCode();
            pcmod = PostalCodeModifier.TypedConstructor(sd.getPostalCodeModifyType());
            sd.Dispose();
        }