private void CircularcalcBtn_Click(object sender, EventArgs e)
        {
            double HCRT, Bt, HLC, WCF, BLT;

            if (Discanalrecttextbox.Text == "" || averageyradTextBox1.Text == "" || rblradTextBox2.Text == "" || cflradTextBox3.Text == "" || calradTextBox4.Text == "" || slopradTextBox5.Text == "" || BtmwdthradTextBox7.Text == "" || SIradTextBox1.Text == "" || LIradTextBox1.Text == "")
            {
                MessageBox.Show("please fill the filled corectly", "message", MessageBoxButtons.OKCancel, MessageBoxIcon.Error);
            }
            else
            {
                QC  = Convert.ToDouble(Discanalrecttextbox.Text);
                Y1  = Convert.ToDouble(averageyradTextBox1.Text);
                RBL = Convert.ToDouble(rblradTextBox2.Text);
                CFL = Convert.ToDouble(cflradTextBox3.Text);
                CAL = Convert.ToDouble(calradTextBox4.Text);
                S   = Convert.ToDouble(slopradTextBox5.Text);
                b   = Convert.ToDouble(BtmwdthradTextBox7.Text);
                LI  = Convert.ToDouble(LIradTextBox1.Text);
                SI  = Convert.ToDouble(SIradTextBox1.Text);
            }

            HCRT = (double)0.9 * Y1;
            Bt   = QC / ((double)1.61 * (Math.Sqrt(Math.Pow(HCRT, 3))));
            HLC  = CAL * S;
            HLI  = LI * SI;

            if (CanaltypecomboBox1.Text == "Trapezoidal")
            {
                WDC = (double)0.8673 * b;
            }
            else if (CanaltypecomboBox1.Text == "Rectangular")
            {
                WDC = (double)b / 2;
            }

            WCF = CFL + HLI + HLC + WDC;
            BLT = WCF - HCRT;

            if (BLT < RBL)
            {
                bwtradTextBox8.Text = Math.Round(Bt, 2).ToString();
                bltradTextBox9.Text = Math.Round(RBL, 2).ToString();
            }
            else
            {
                bwtradTextBox8.Text = Bt.ToString();
                bltradTextBox9.Text = BLT.ToString();
            }


            radButton1.Visible = true;
        }
Exemplo n.º 2
0
        protected override bool ExecuteParent(ArraySegment <string> arguments, ICommandSender sender, out string response)
        {
            EventHandlers.LogCommandUsed((CommandSender)sender, EventHandlers.FormatArguments(arguments, 0));
            StringBuilder ListBuilder = new StringBuilder();

            ListBuilder.Append("Here are the following enums you can use in commands:\n\nBreakType: ");
            foreach (BreakType Bt in Enum.GetValues(typeof(BreakType)))
            {
                ListBuilder.Append(Bt.ToString());
                ListBuilder.Append(" ");
            }
            ListBuilder.AppendLine();
            ListBuilder.Append("MoveType: ");
            foreach (MoveType Mt in Enum.GetValues(typeof(MoveType)))
            {
                ListBuilder.Append(Mt.ToString());
                ListBuilder.Append(" ");
            }
            ListBuilder.AppendLine();
            ListBuilder.Append("GrenadeType: ");
            foreach (GrenadeType Gt in Enum.GetValues(typeof(GrenadeType)))
            {
                ListBuilder.Append(Gt.ToString());
                ListBuilder.Append(" ");
            }
            ListBuilder.AppendLine();
            ListBuilder.Append("VectorAxis: ");
            foreach (VectorAxis Va in Enum.GetValues(typeof(VectorAxis)))
            {
                ListBuilder.Append(Va.ToString());
                ListBuilder.Append(" ");
            }
            ListBuilder.AppendLine();
            ListBuilder.Append("PositionModifier: ");
            foreach (PositionModifier Pm in Enum.GetValues(typeof(PositionModifier)))
            {
                ListBuilder.Append(Pm.ToString());
                ListBuilder.Append(" ");
            }
            string message = ListBuilder.ToString();

            ListBuilder.Clear();
            response = message;
            return(true);
        }