Ejemplo n.º 1
0
        private void LoadFormConfiguration()
        {
            ProgramConfiguraton.LoadFormParams(this, ConfigFormOption.Location | ConfigFormOption.Size);

            string text; decimal tmpDecimal;

            text = LocalConfiguration.LoadControlCustomParameter(nUDNumberCount, "Value");
            if (!string.IsNullOrEmpty(text) && decimal.TryParse(text, out tmpDecimal))
            {
                nUDNumberCount.Value = tmpDecimal;
            }

            text = LocalConfiguration.LoadControlCustomParameter(nUDTimeForNumber, "Value");
            if (!string.IsNullOrEmpty(text) && decimal.TryParse(text, out tmpDecimal))
            {
                nUDTimeForNumber.Value = tmpDecimal;
            }

            cBTimeForNumber.Checked = LocalConfiguration.LoadControlCustomParameter(cBTimeForNumber, "Checked") == "1";

            cBCounter.Checked        = LocalConfiguration.LoadControlCustomParameter(cBCounter, "Checked") == "1";
            cBRandomPosition.Checked = LocalConfiguration.LoadControlCustomParameter(cBRandomPosition, "Checked") == "1";
            cBWithNumber.Checked     = LocalConfiguration.LoadControlCustomParameter(cBWithNumber, "Checked") == "1";

            LocalConfiguration.LoadListCheckedItems(this, netCheckedListBox.ListBox);

            this.FormClosed += new FormClosedEventHandler(SaveFormConfiguration);
        }
Ejemplo n.º 2
0
        private void LoadFormConfiguration()
        {
            decimal tempDecimal;
            int     tempInt;
            string  tempString;

            ProgramConfiguraton.LoadFormParams(this, ConfigFormOption.Location);

            LocalConfiguration.LoadListCheckedItems(this, netCheckedListBox.ListBox);

            tempString = LocalConfiguration.LoadControlCustomParameter(cBTestType, "SelectedIndex");
            if (!string.IsNullOrEmpty(tempString) && int.TryParse(tempString, out tempInt))
            {
                if (tempInt >= 0 && tempInt < cBTestType.Items.Count)
                {
                    cBTestType.SelectedIndex = tempInt;
                }
            }

            tempString = LocalConfiguration.LoadControlCustomParameter(nUDRight, "Value");
            if (!string.IsNullOrEmpty(tempString) && decimal.TryParse(tempString, out tempDecimal))
            {
                nUDRight.Value = tempDecimal;
            }

            tempString = LocalConfiguration.LoadControlCustomParameter(nUDLeft, "Value");
            if (!string.IsNullOrEmpty(tempString) && decimal.TryParse(tempString, out tempDecimal))
            {
                nUDLeft.Value = tempDecimal;
            }

            chbValueRange.Checked = LocalConfiguration.LoadControlCustomParameter(chbValueRange, "Checked") == "1";

            rBNumber.Checked      = LocalConfiguration.LoadControlCustomParameter(rBNumber, "Checked") == "0";
            rBCalculation.Checked = LocalConfiguration.LoadControlCustomParameter(rBCalculation, "Checked") == "1";

            if (!rBNumber.Checked && !rBCalculation.Checked)
            {
                rBNumber.Checked = true;
            }

            chBVisionTime.Checked = LocalConfiguration.LoadControlCustomParameter(chBVisionTime, "Checked") == "1";

            tempString = LocalConfiguration.LoadControlCustomParameter(nUDVisibleTime, "Value");
            if (!string.IsNullOrEmpty(tempString) && decimal.TryParse(tempString, out tempDecimal))
            {
                nUDVisibleTime.Value = tempDecimal;
            }

            this.FormClosed += new FormClosedEventHandler(SaveFormConfiguration);
        }
        private void LoadFormConfiguration()
        {
            decimal tmpDecimal;

            ProgramConfiguraton.LoadFormParams(this, ConfigFormOption.Location);

            string text = LocalConfiguration.LoadControlCustomParameter(nUDSymbolsCount, "Value");

            if (!string.IsNullOrEmpty(text) && decimal.TryParse(text, out tmpDecimal))
            {
                nUDSymbolsCount.Value = tmpDecimal;
            }

            text = LocalConfiguration.LoadControlCustomParameter(nUDVisibleTime, "Value");
            if (!string.IsNullOrEmpty(text) && decimal.TryParse(text, out tmpDecimal))
            {
                nUDVisibleTime.Value = tmpDecimal;
            }

            text = LocalConfiguration.LoadControlCustomParameter(nUDTimeForAnswer, "Value");
            if (!string.IsNullOrEmpty(text) && decimal.TryParse(text, out tmpDecimal))
            {
                nUDTimeForAnswer.Value = tmpDecimal;
            }

            text = LocalConfiguration.LoadControlCustomParameter(nUDRight, "Value");
            if (!string.IsNullOrEmpty(text) && decimal.TryParse(text, out tmpDecimal))
            {
                nUDRight.Value = tmpDecimal;
            }

            text = LocalConfiguration.LoadControlCustomParameter(nUDLeft, "Value");
            if (!string.IsNullOrEmpty(text) && decimal.TryParse(text, out tmpDecimal))
            {
                nUDLeft.Value = tmpDecimal;
            }

            chbValueRange.Checked = LocalConfiguration.LoadControlCustomParameter(chbValueRange, "Checked") == "1";

            chBTimeForAnswer.Checked = LocalConfiguration.LoadControlCustomParameter(chBTimeForAnswer, "Checked") == "1";
            chBAutoShow.Checked      = LocalConfiguration.LoadControlCustomParameter(chBAutoShow, "Checked") == "1";

            LocalConfiguration.LoadListCheckedItems(this, netCheckedListBox.ListBox);

            this.FormClosed += new FormClosedEventHandler(SaveFormConfiguration);
        }