コード例 #1
0
        private void btnCalculate_Click(object sender, RoutedEventArgs e)
        {
            //TODO
            try
            {
                double resultPer, resultArea, resultBzlArea;

                double width    = double.Parse(txtWidht.Text);
                double height   = double.Parse(txtHeight.Text);
                double bzlWidth = double.Parse(txtBzlWidth.Text);

                resultBzlArea = BusinessLogicWindow.BezelCalculateArea(bzlWidth, width, height);
                resultPer     = BusinessLogicWindow.CalculatePerimeter(width, height);
                resultArea    = BusinessLogicWindow.CalculateArea(width, height) - resultBzlArea;


                txtArea.Text    = resultArea.ToString();
                txtPer.Text     = resultPer.ToString();
                txtBzlArea.Text = resultBzlArea.ToString();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                //yield to an user that everything okay
            }
        }