Esempio n. 1
0
 public Rectangle(Rectangle rectangle)
     : base(rectangle.Color)
 {
     //this.Color = rectangle.Color;
     this.width = rectangle.width;
     this.height = rectangle.height;
 }
Esempio n. 2
0
 public Rectangle(Rectangle A)
     : base(A.Color)
 {
     Color = A.Color;
     Width = A.Width;
     Height = A.Height;
 }
Esempio n. 3
0
        public static void Main(string[] args)
        {
            Shape s1 = new Rectangle("red", 4, 5);
            Console.WriteLine (s1);

            Shape s2 = new Triangle("blue", 4, 5);
            Console.WriteLine (s2);

            Shape s3 = new Rectangle();
            Console.WriteLine (s3);

            Rectangle r1 = new Rectangle((Rectangle)s1);
            Console.WriteLine (r1);
            r1.Width=-5.0; r1.Height=15;
            Console.WriteLine (r1);

            Triangle t1 = new Triangle();
            t1.Width=3; t1.Height=4;
            Console.WriteLine (t1);

            //Shape s4 = new Shape("green");
            //Console.WriteLine (s4);

            Console.WriteLine ("Perimeter of s1: {0}",printPerimeter (s1));
            Console.WriteLine ("Perimeter of s2: {0}",printPerimeter (s2));
            Console.WriteLine ("Perimeter of s3: {0}",printPerimeter (s3));
            Console.WriteLine ("Perimeter of r1: {0}",printPerimeter (r1));
            Console.WriteLine ("Perimeter of t1: {0}",printPerimeter (t1));
        }
Esempio n. 4
0
 public Rectangle(Rectangle cpy)
 {
     _width = cpy.Width;
     _height = cpy.Height;
     _color = cpy.Color;
 }
Esempio n. 5
0
 public static double printPerimeter(Rectangle s)
 {
     return s.getPerimeter();
 }
Esempio n. 6
0
 public Triangle(Rectangle a)
     : base(a.color)
 {
     this.width = a.width;
     this.hight = a.hight;
 }
Esempio n. 7
0
 public Rectangle(Rectangle r)
 {
     Width = r.Width;
     Height = r.Height;
     _Color = r._Color;
 }
Esempio n. 8
0
 public Rectangle( Rectangle r)
 {
     _Color = r._Color;
     Width = r._Width;
     Height = r._Height;
 }
Esempio n. 9
0
 public Rectangle(Rectangle r1)
     : base(r1.Color)
 {
     width = r1.Width;
     height = r1.Height;
 }
Esempio n. 10
0
 public Rectangle(Rectangle r)
     : base(r.Color)
 {
     _Width = r._Width;
     _Height = r._Height;
 }
Esempio n. 11
0
 public Triangle(Rectangle R)
     : base(R.Color)
 {
     this.Width = R.Width;
     this.Height = R.Height;
 }
Esempio n. 12
0
 public Rectangle(Rectangle r)
     : base(r.color)
 {
     _Height = r._Height;
     _Width = r._Width;
 }
Esempio n. 13
0
 public Rectangle(Rectangle r)
 {
     _color = r._color;
     Width = r.Width;
     Height = r.Height;
 }
Esempio n. 14
0
 public Rectangle(Rectangle r)
     : base(r.Color)
 {
     Width = r.Width;
     Height = r.Height;
 }
Esempio n. 15
0
 public Rectangle(Rectangle r)
     : base(r.color)
 {
     _height = r._height;
     _width = r._width;
 }
Esempio n. 16
0
 public Triangle(Rectangle r)
     : base(r.color)
 {
     Width = r.Width;
     Height = r.Height;
 }
Esempio n. 17
0
 public Rectangle(Rectangle R)
     : base(R.color)
 {
     Width = R.Width;
     Height = R.Height;
 }
Esempio n. 18
0
 public Rectangle(Rectangle R)
     : base(R.Color)
 {
     _height = R.Height;
     _width = R.Width;
 }
Esempio n. 19
0
 public Rectangle(Rectangle s)
 {
     _color = s.Color;
     _width = s.Width;
     _height = s.Height;
 }