Пример #1
0
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            ConditionForm cf = new ConditionForm(tasker);

            cf.ShowDialog();
            if (cf.res == DialogResult.OK)
            {
                Condition add = new Condition();
                add.b_ID     = cf.checkBox_ID.Checked;
                add.b_Mes_E  = cf.checkBox_Message_E.Checked;
                add.b_Mes_R  = cf.checkBox_Message_R.Checked;
                add.b_Name_E = cf.checkBox_Name_E.Checked;
                add.b_Name_R = cf.checkBox_Name_R.Checked;
                add.b_Sorse  = cf.checkBox_sorce.Checked;

                add.d_ID     = cf.textBox_ID.Text;
                add.d_Mes    = cf.textBox_Mes_R.Text;
                add.d_Name   = cf.textBox_Name_R.Text;
                add.d_Sorse  = cf.comboBox_Sorce.Text;
                add.toChange = cf.comboBox_ToChange.Text;

                add.d_AddAdder   = cf.textAddSrc.Text;
                add.b_AddAdder_E = cf.check_AddsorceE.Checked;
                add.b_AddAdder_R = cf.check_Addsorce_R.Checked;

                add.d_AddSender   = cf.textAddSender.Text;
                add.b_AddSender_E = cf.checkAddSenderE.Checked;
                add.b_AddSender_R = cf.checkAddSenderR.Checked;

                cList.clist.Add(add);
                cList.Save("Task_Yomikae.config");

                ListViewItem additem = new ListViewItem(add.ToString());
                additem.Tag = add;

                listView1.Items.Add(additem);
            }
        }
Пример #2
0
        private void buttonSet_Click(object sender, EventArgs e)
        {
            if (listView1.SelectedItems.Count == 0)
            {
                return;
            }

            Condition select = (Condition)listView1.SelectedItems[0].Tag;

            ConditionForm cf = new ConditionForm(tasker);

            cf.checkBox_ID.Checked        = select.b_ID;
            cf.checkBox_Message_E.Checked = select.b_Mes_E;
            cf.checkBox_Message_R.Checked = select.b_Mes_R;
            cf.checkBox_Name_E.Checked    = select.b_Name_E;
            cf.checkBox_Name_R.Checked    = select.b_Name_R;
            cf.checkBox_sorce.Checked     = select.b_Sorse;

            cf.textBox_ID.Text     = select.d_ID;
            cf.textBox_Mes_R.Text  = select.d_Mes;
            cf.textBox_Name_R.Text = select.d_Name;

            cf.comboBox_Sorce.Text    = select.d_Sorse;
            cf.comboBox_ToChange.Text = select.toChange;

            cf.textAddSender.Text      = select.d_AddSender;
            cf.checkAddSenderE.Checked = select.b_AddSender_E;
            cf.checkAddSenderR.Checked = select.b_AddSender_R;

            cf.textAddSrc.Text          = select.d_AddAdder;
            cf.check_AddsorceE.Checked  = select.b_AddAdder_E;
            cf.check_Addsorce_R.Checked = select.b_AddAdder_R;

            cf.ShowDialog();

            if (cf.res == DialogResult.OK)
            {
                select.b_ID     = cf.checkBox_ID.Checked;
                select.b_Mes_E  = cf.checkBox_Message_E.Checked;
                select.b_Mes_R  = cf.checkBox_Message_R.Checked;
                select.b_Name_E = cf.checkBox_Name_E.Checked;
                select.b_Name_R = cf.checkBox_Name_R.Checked;
                select.b_Sorse  = cf.checkBox_sorce.Checked;

                select.d_ID     = cf.textBox_ID.Text;
                select.d_Mes    = cf.textBox_Mes_R.Text;
                select.d_Name   = cf.textBox_Name_R.Text;
                select.d_Sorse  = cf.comboBox_Sorce.Text;
                select.toChange = cf.comboBox_ToChange.Text;

                select.d_AddAdder   = cf.textAddSrc.Text;
                select.b_AddAdder_E = cf.check_AddsorceE.Checked;
                select.b_AddAdder_R = cf.check_Addsorce_R.Checked;

                select.d_AddSender   = cf.textAddSender.Text;
                select.b_AddSender_E = cf.checkAddSenderE.Checked;
                select.b_AddSender_R = cf.checkAddSenderR.Checked;

                cList.Save("Task_Yomikae.config");
            }
        }