Ejemplo n.º 1
0
 private void BtnDispose_Click(object sender, EventArgs e)
 {
     // clears out ojects based on which radio button is checked when the Disposed button is clicked.
     if (rdoCircle.Checked)
     {
         Circle        = null;
         txtError.Text = "Circal data removed";
     }
     else
     {
         Cylinder      = null;
         txtError.Text = "Cylinder data removed";
     }
     setupfromForCircleOrCylinder();
 }
Ejemplo n.º 2
0
        private void runCylinder()
        {
            // calculates Cylinder info using the Cylinder class

            txtError.Text = "Getting info for Cylinder";

            //initialize new Cylinder object
            if (Cylinder == null)
            {
                Cylinder = new clsCylinder();
            }

            // Sets Properties
            Cylinder.Radius = Convert.ToDecimal(txtRadius.Text);
            Cylinder.Height = Convert.ToDecimal(txtHeight.Text);

            // Updates textboxes
            txtArea.Text          = Cylinder.Area().ToString();
            txtVolume.Text        = Cylinder.Volume().ToString();
            txtCircumference.Text = Cylinder.Circumference().ToString();
            setupfromForCircleOrCylinder();
        }