public bool Draw(Shape shape)
        {
            if (shape != null)
            {
                using (Graph = Graphics.FromImage(BM))
                {
                    switch (shape.Name)
                    {
                    case ShapeEnumeration.square:
                        if (shape.Dimension_2 != null)
                        {
                            return(false);
                        }
                        Rectangle square = new Rectangle(Convert.ToInt32(Central.X - shape.Dimension_1 / 2), Convert.ToInt32(Central.Y - shape.Dimension_1 / 2), shape.Dimension_1, shape.Dimension_1);
                        Graph.DrawRectangle(BlackPen, square);
                        break;

                    case ShapeEnumeration.rectangle:
                        if (shape.Dimension_2 == null)
                        {
                            shape.Dimension_2 = shape.Dimension_1;
                        }
                        Rectangle rectangle = new Rectangle(Convert.ToInt32(Central.X - shape.Dimension_2 / 2), Convert.ToInt32(Central.Y - shape.Dimension_1 / 2), shape.Dimension_2 ?? default(int), shape.Dimension_1);
                        Graph.DrawRectangle(BlackPen, rectangle);
                        break;

                    case ShapeEnumeration.scalenetriangle:
                        if (shape.Dimension_2 == null)
                        {
                            shape.Dimension_2 = shape.Dimension_1;
                        }
                        Graph.DrawPolygon(BlackPen, PointsForScaleneTriangle(shape));
                        break;

                    case ShapeEnumeration.isoscelestriangle:
                        if (shape.Dimension_2 == null)
                        {
                            shape.Dimension_2 = shape.Dimension_1;
                        }
                        Graph.DrawPolygon(BlackPen, PointsForIsoscelesTriangle(shape));
                        break;

                    case ShapeEnumeration.equilateraltriangle:
                        if (shape.Dimension_2 != null)
                        {
                            return(false);
                        }
                        Graph.DrawPolygon(BlackPen, PointsForPolygon(3, Convert.ToInt32(GenarateRadius(3, shape.Dimension_1)) / 2));
                        break;

                    case ShapeEnumeration.parallelogram:
                        if (shape.Dimension_2 == null)
                        {
                            shape.Dimension_2 = shape.Dimension_1;
                        }
                        Graph.DrawPolygon(BlackPen, PointsForParallelogram(shape));
                        break;

                    case ShapeEnumeration.pentagon:
                        if (shape.Dimension_2 != null)
                        {
                            return(false);
                        }
                        Graph.DrawPolygon(BlackPen, PointsForPolygon(5, Convert.ToInt32(GenarateRadius(5, shape.Dimension_1)) / 2));
                        break;

                    case ShapeEnumeration.hexagon:
                        if (shape.Dimension_2 != null)
                        {
                            return(false);
                        }
                        Graph.DrawPolygon(BlackPen, PointsForPolygon(6, Convert.ToInt32(GenarateRadius(6, shape.Dimension_1)) / 2));
                        break;

                    case ShapeEnumeration.heptagon:
                        if (shape.Dimension_2 != null)
                        {
                            return(false);
                        }
                        Graph.DrawPolygon(BlackPen, PointsForPolygon(7, Convert.ToInt32(GenarateRadius(7, shape.Dimension_1)) / 2));
                        break;

                    case ShapeEnumeration.octagon:
                        if (shape.Dimension_2 != null)
                        {
                            return(false);
                        }
                        Graph.DrawPolygon(BlackPen, PointsForPolygon(8, Convert.ToInt32(GenarateRadius(8, shape.Dimension_1)) / 2));
                        break;

                    case ShapeEnumeration.circle:
                        if (shape.Dimension_2 != null)
                        {
                            return(false);
                        }
                        Graph.DrawEllipse(BlackPen, Central.X - shape.Dimension_1, Central.Y - shape.Dimension_1, shape.Dimension_1 * 2, shape.Dimension_1 * 2);
                        break;

                    case ShapeEnumeration.oval:
                        if (shape.Dimension_2 == null)
                        {
                            shape.Dimension_2 = shape.Dimension_1;
                        }
                        Graph.DrawEllipse(BlackPen, Convert.ToInt32(Central.X - 0.5 * shape.Dimension_2), Convert.ToInt32(Central.Y - 0.5 * shape.Dimension_1), shape.Dimension_2 ?? default(int), shape.Dimension_1);
                        break;
                    }
                }
                BM.Save("../Jeylabs_puzzle/wwwroot/images/shape.JPG");
                return(true);
            }
            return(false);
        }