예제 #1
0
        internal static void showForm(Form1 form1, Form1.RtdbOptions opts = null)
        {
            if (opts == null)
            {
                opts = Form1.opts;
            }

            if (self != null && self.IsDisposed)
            {
                self = null;
            }

            if (self != null)
            {
                self.showOptions(opts);
                self.Focus();
                self.BringToFront();
                return;
            }

            mainForm = form1;

            self = new OptionForm();
            self.showOptions(opts);
            self.Show();
        }
예제 #2
0
        public void showOptions(Form1.RtdbOptions opts = null)
        {
            // Form1.opts так же используется для обновления настроек при сохранении опций, т.к. переданный параметр не сохраняется
            if (opts == null)
            {
                opts = Form1.opts;
            }

            mainForm.refreshOptions(true);

            // При добавлении новых полей изменить так же isOptionsChanged и putOptions
            numericUpDown1.Value  = opts[Form1.optsName[0], 0];
            numericUpDown2.Value  = opts[Form1.optsName[1], 0];
            numericUpDown3.Value  = opts[Form1.optsName[2], 0];
            numericUpDown4.Value  = opts[Form1.optsName[10], 0];
            numericUpDown5.Value  = opts[Form1.optsName[19], 0];
            numericUpDown6.Value  = opts[Form1.optsName[13], 0];
            numericUpDown7.Value  = opts[Form1.optsName[12], 0];
            numericUpDown8.Value  = opts[Form1.optsName[20], 0];
            numericUpDown9.Value  = opts[Form1.optsName[24], 0];
            numericUpDown10.Value = opts[Form1.optsName[23], 0];
            numericUpDown11.Value = opts[Form1.optsName[26], 0];
            numericUpDown12.Value = opts[Form1.optsName[28], 0];
            numericUpDown13.Value = opts[Form1.optsName[30], 0];
            numericUpDown14.Value = opts[Form1.optsName[31], 0];
            numericUpDown15.Value = opts[Form1.optsName[33], 0];
            textBox1.Text         = opts[Form1.optsName[5], ""];
            checkBox2.Checked     = opts[Form1.optsName[4], true];
            checkBox1.Checked     = opts[Form1.optsName[3], true];
            checkBox3.Checked     = opts[Form1.optsName[8], true];
            checkBox4.Checked     = opts[Form1.optsName[14], true];
            checkBox5.Checked     = opts[Form1.optsName[15], true];
            checkBox6.Checked     = opts[Form1.optsName[16], true];
            checkBox7.Checked     = opts[Form1.optsName[18], true];
            checkBox8.Checked     = opts[Form1.optsName[22], true];
            checkBox9.Checked     = opts[Form1.optsName[25], true];
            checkBox10.Checked    = opts[Form1.optsName[27], true];
            checkBox34.Checked    = opts[Form1.optsName[34], true];

            comboBox1.SelectedIndex = Form1.opts[Form1.optsName[21], 0] - 1;
            comboBox2.SelectedIndex = Form1.opts[Form1.optsName[29], 0];
            comboBox3.SelectedIndex = Form1.opts[Form1.optsName[32], 0];

            saved = 0;
        }