示例#1
0
        protected override string Render(Rectangle rectangle)
        {
            var r = rectangle.Rectangle;

            if (rectangle.Fill && rectangle.Stroke)
            {
                return($@"<rect x=""{r.X}"" y=""{r.Y}"" width=""{r.Width}"" height=""{r.Height}"" style=""fill:{ColorToHtml(FillColor)};stroke:{ColorToHtml(StrokeColor)};stroke-width:{StrokeWidth};"" />");
            }

            if (rectangle.Fill)
            {
                return($@"<rect x=""{r.X}"" y=""{r.Y}"" width=""{r.Width}"" height=""{r.Height}"" style=""fill:{ColorToHtml(FillColor)};"" />");
            }

            if (rectangle.Stroke)
            {
                return($@"<rect x=""{r.X}"" y=""{r.Y}"" width=""{r.Width}"" height=""{r.Height}"" style=""stroke:{ColorToHtml(StrokeColor)};stroke-width:{StrokeWidth};"" />");
            }

            return("");
        }
示例#2
0
 protected abstract string Render(Rectangle rectangle);