Esempio n. 1
0
        private void VoltageToLaserChanged(object sender, EventArgs e)
        {
            if (!VoltageToLaserTextBox.Focused && !VoltageTrackBar.Focused)
            {
                return;
            }
            double number;

            System.Globalization.NumberStyles numberStyle = System.Globalization.NumberStyles.Number; // Determines what formats are allowed for numbers
            if (Double.TryParse(VoltageToLaserTextBox.Text, numberStyle, System.Globalization.CultureInfo.InvariantCulture, out number))
            {
                Controller.VoltageToSlaveLaserChanged(CavityPanel.CavityName, name, number);
            }
            else
            {
                Controller.ShowDialog(
                    "Invalid entry",
                    "Couldn't convert '" + VoltageToLaserTextBox.Text + "' to a double."
                    );
            }
        }