private void ButtonSetAll_Click(object sender, EventArgs e)
 {
     try
     {
         RadialGenerator1.SetAll(Double.Parse(TextBoxRadialValue.Text));
         ClearCusor();
     }
     catch (FormatException)
     {
     }
 }
        private void ButtonLoadRadialData_Click(object sender, EventArgs e)
        {
            // Displays an OpenFileDialog so the user can select a Cursor.
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Filter = "Radial Data Files|*.raddata";
            openFileDialog.Title  = "Select a radial data file";

            // Show the Dialog.
            // If the user clicked OK in the dialog
            if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK && openFileDialog.CheckFileExists)
            {
                byte[] fileBytes = File.ReadAllBytes(openFileDialog.FileName);

                RadialGenerator1.Rings             = fileBytes[0];
                NumericUpDownRingCount.Value       = RadialGenerator1.Rings;
                RadialGenerator1.PerimeterPoints   = fileBytes[1];
                NumericUpDownPerimeterPoints.Value = RadialGenerator1.PerimeterPoints;
                RadialGenerator1.Dimension         = fileBytes[2];
                NumericUpDownDimension.Value       = RadialGenerator1.Dimension;
                RadialGenerator1.OuterRadius       = fileBytes[3];
                NumericUpDownOuterRadius.Value     = RadialGenerator1.OuterRadius;
                RadialGenerator1.InnerRadius       = fileBytes[4];
                NumericUpDownInnerRadius.Value     = RadialGenerator1.InnerRadius;

                for (int i = 0; i < RadialGenerator1.Rings; i++)
                {
                    int frameStartIndex = 5 + (i * RadialGenerator1.PerimeterPoints * 8);
                    for (int j = 0; j < RadialGenerator1.PerimeterPoints; j++)
                    {
                        int    subFrameStartIndex = frameStartIndex + (j * 8);
                        double value = BitConverter.ToDouble(fileBytes, subFrameStartIndex);
                        RadialGenerator1.RingArray[i].ringPoints[j].QuickSetValue(value);
                    }
                }

                ClearCusor();
                RadialGenerator1.ValueChanged();
            }
        }
 private void ButtonInterpolateLine_Click(object sender, EventArgs e)
 {
     RadialGenerator1.InterpolateLine();
     ClearCusor();
 }