示例#1
0
        private void SetSequenceOfRDE()
        {
            int[] speeds = { };
            int   result;

            for (int i = 0; i < _comboboxes.Length; i++)
            {
                if (_checkboxes[i].Checked)
                {
                    //speeds[i] = int.Parse(_checkboxes[i].Text);

                    if (int.TryParse(_comboboxes[i].Text, out result) && (result <= 6400) && (result >= 100))
                    {
                        Array.Resize(ref speeds, speeds.Length + 1);
                        speeds[i] = result;
                    }
                    else
                    {
                        MessageBox.Show(this, "One of values for the rotation speed is invalid."); return;
                    }
                }
                else
                {
                    break;
                }
            }

            _ps.SetSequenceOfRDE(speeds);
        }