Example #1
0
 public override string ToString()
 {
     // using string interpolation!!!
     return($"[Top left point -  {TopLeft.ToString()}\n" +
            $"Bottom right point - {BotRight.ToString()}\n" +
            $"Height - {Height}\n" +
            $"Width - {Width}]\n");
 }
Example #2
0
 public override Shape ToBounds(Rectangle fromBounds, Rectangle toBounds)
 {
     return(new Triangle
            (
                Top.TranslatePoint(fromBounds, toBounds),
                BotLeft.TranslatePoint(fromBounds, toBounds),
                BotRight.TranslatePoint(fromBounds, toBounds)
            ));
 }
Example #3
0
        public object Clone()
        {
            var rectangle = (Rectangle)MemberwiseClone();

            rectangle.TopLeft  = (Point)TopLeft.Clone();
            rectangle.BotRight = (Point)BotRight.Clone();

            return(rectangle);
        }
Example #4
0
 public override string ToString()
 {
     return($"A Rectangle from {TopLeft.ToCoord()} to {BotRight.ToCoord()}");
 }