Esempio n. 1
0
        /// <summary>
        /// calculate the information about a shape
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnCalc_Click(object sender, EventArgs e)
        {
            OutputBox.Clear();
            _selectedShape.MainPoint = new Point(Convert.ToInt32(XText.Text), Convert.ToInt32(YText.Text));
            if (HeightText.Text != "")
            {
                _selectedShape.Height = Convert.ToInt32(HeightText.Text);
            }
            if (WidthText.Text != "")
            {
                _selectedShape.Width = Convert.ToInt32(WidthText.Text);
            }
            if (DepthText.Text != "")
            {
                _selectedShape.Depth = Convert.ToInt32(DepthText.Text);
            }
            if (RadiusText.Text != "")
            {
                _selectedShape.Radius = Convert.ToInt32(RadiusText.Text);
            }

            _selectedShape.SetAttributes();
            OutputBox.Text         = _selectedShape.ToString();
            ShapePic.ImageLocation = _selectedShape.Picture;
        }