Exemplo n.º 1
0
        /// <summary>
        /// определение общих настроек
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void commonOptions_Click(object sender, EventArgs e)
        {
            CommonOptionsForm opt = new CommonOptionsForm();

            opt.numericUpDownDevice.Value = bios.Options.Device;
            opt.numericUpDownDeviceAnswerTimeout.Value = bios.Options.TimeoutForResponseFromDevice;
            opt.numericUpDownTimeoutForAnswer.Value    = bios.Options.TimeoutBetweenAttemptsToReadWrite;
            opt.numericUpDownCountDo.Value             = bios.Options.AttemptsToReadWriteEntries;
            opt.numericUpDownDataCheck.Value           = bios.Options.NumberOfDataChecks;

            if (opt.ShowDialog(this) == DialogResult.OK)
            {
                bios.Options.Device = (int)opt.numericUpDownDevice.Value;
                bios.Options.TimeoutForResponseFromDevice      = (int)opt.numericUpDownDeviceAnswerTimeout.Value;
                bios.Options.TimeoutBetweenAttemptsToReadWrite = (int)opt.numericUpDownTimeoutForAnswer.Value;
                bios.Options.AttemptsToReadWriteEntries        = (int)opt.numericUpDownCountDo.Value;
                bios.Options.NumberOfDataChecks = (int)opt.numericUpDownDataCheck.Value;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// определение общих настроек
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void commonOptions_Click(object sender, EventArgs e)
        {
            CommonOptionsForm opt = new CommonOptionsForm();

            opt.numericUpDownDevice.Value = bios.Options.Device;
            opt.numericUpDownDeviceAnswerTimeout.Value = bios.Options.TimeoutForResponseFromDevice;
            opt.numericUpDownTimeoutForAnswer.Value = bios.Options.TimeoutBetweenAttemptsToReadWrite;
            opt.numericUpDownCountDo.Value = bios.Options.AttemptsToReadWriteEntries;
            opt.numericUpDownDataCheck.Value = bios.Options.NumberOfDataChecks;

            if (opt.ShowDialog(this) == DialogResult.OK)
            {
                bios.Options.Device = (int)opt.numericUpDownDevice.Value;
                bios.Options.TimeoutForResponseFromDevice = (int)opt.numericUpDownDeviceAnswerTimeout.Value;
                bios.Options.TimeoutBetweenAttemptsToReadWrite = (int)opt.numericUpDownTimeoutForAnswer.Value;
                bios.Options.AttemptsToReadWriteEntries = (int)opt.numericUpDownCountDo.Value;
                bios.Options.NumberOfDataChecks = (int)opt.numericUpDownDataCheck.Value;
            }
        }