Canguro.Commands.Forms.SectionsGUI.nextButton2_Click C# (CSharp) Method

nextButton2_Click() private method

private nextButton2_Click ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void
        private void nextButton2_Click(object sender, EventArgs e)
        {
            if (currentSection == null)
            {
                currentMaterial = MaterialManager.Instance.Materials[materialComboBox.SelectedItem.ToString()];

                string secName = nameTextBox.Text;
                ConcreteSectionProps cProps = (currentMaterial.DesignProperties is ConcreteDesignProps) ? concreteSectionProps[0] : null;

                if (shapeNames["R"].Equals(shapeComboBox.SelectedItem.ToString()))
                    currentSection = new Rectangular(secName, currentMaterial, cProps, 0.2f, 0.4f);
                else if (shapeNames["RN"].Equals(shapeComboBox.SelectedItem.ToString()))
                    currentSection = new Circle(secName, currentMaterial, cProps, 0.4f);
                //else if (shapeNames["2L"].Equals(shapeComboBox.SelectedItem.ToString()))
                //    currentSection = new DoubleAngle(secName, "2L", currentMaterial, cProps, 0.2f, 0.2f, 0.02f, 0.02f);
                else if (shapeNames["C"].Equals(shapeComboBox.SelectedItem.ToString()))
                    currentSection = new Channel(secName, "C", currentMaterial, cProps, 0.2f, 0.2f, 0.02f, 0.02f);
                else if (shapeNames["I"].Equals(shapeComboBox.SelectedItem.ToString()))
                    currentSection = new IWideFlange(secName, "C", currentMaterial, cProps, 0.2f, 0.2f, 0.02f, 0.02f);
                else if (shapeNames["B"].Equals(shapeComboBox.SelectedItem.ToString()))
                    currentSection = new BoxTube(secName, "B", currentMaterial, cProps, 0.2f, 0.2f, 0.02f, 0.02f);
                else if (shapeNames["P"].Equals(shapeComboBox.SelectedItem.ToString()))
                    currentSection = new Pipe(secName, "P", currentMaterial, cProps, 0.2f, 0.02f);
                else if (shapeNames["L"].Equals(shapeComboBox.SelectedItem.ToString()))
                    currentSection = new Angle(secName, "L", currentMaterial, cProps, 0.2f, 0.2f, 0.02f, 0.02f);
                else if (shapeNames["T"].Equals(shapeComboBox.SelectedItem.ToString()))
                    currentSection = new Tee(secName, "T", currentMaterial, cProps, 0.2f, 0.2f, 0.02f, 0.02f);
                else
                    currentSection = new General(secName, "G", currentMaterial, cProps, 0.2f, 0.2f, 0, 0, 0, 0, 0, 0.0043f, 9.65e-8f, 0.0000657f, 0.0000033f, 0.002f, 0.002f, 0.00043f, 0.000052f, 0.00049f, 0.000081f, 0.1241f, 0.0278f);
            }

            UpdateModel(1);

            if (currentSection.GetType().Name.Equals("General"))
                wizardControl.SelectTab(4);
            else
                wizardControl.SelectTab(2);

            //if (currentSection is Rectangular || currentSection is Circle)
            //  wizardControl.SelectTab(2);
            //else
            //    wizardControl.SelectTab(0);
            DialogResult = DialogResult.None;
        }