using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{     
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Circle c = new Circle(10);
            //c.Radius = 5;
            MessageBox.Show(c.Pyramid().ToString());
        }
    }
    class Circle
    {
        private Double _Radius;
        public Double Radius
        {
            get { return _Radius; }
            set
            {
                if (value < 0)
                    //throw new Exception("Radius Is Negative");
                    _Radius = 0;
                else
                    _Radius = value;
            }
        }
        public Double Area()
        {
            return (Math.PI * Radius * Radius);
        }
        public Double Pyramid()
        {
            return (2 * Math.PI * Radius);
        }
        /// <summary>
        /// سازنده
        /// </summary>
        /// <param name="Radius">شعاع</param>
        public Circle(Double Radius)
        {
            this.Radius = Radius;
        }
        public Circle()
        {
            Radius = 0;
        }
        ~Circle()
        {
            System.Windows.Forms.MessageBox.Show("خاتمه");
        }
    }
}
