Beispiel #1
0
        public override void Draw(Graphics graphics)
        {
            // Card
            var rect = new Rectangle(X, Y, _width, _height);
            var path = RoundedRect(rect, 10);

            graphics.FillPath(new SolidBrush(Color.White), path);
            graphics.DrawPath(new Pen(Color.Black), path);

            // Color
            var rect2 = new Rectangle(X + 5, Y + 5, _width - 10, 30);
            var path2 = RoundedRect(rect2, 5);

            graphics.FillPath(new SolidBrush(_horse.GetPlaceColor()), path2);

            // Name
            graphics.DrawString(_horse.GetName(), new Font("Arial", 12f, FontStyle.Bold), new SolidBrush(Color.White), rect2,
                                new StringFormat()
            {
                Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center
            });

            var currY = Y + 40;

            graphics.DrawString($"Cena: {_horse.GetPrice().ToThousandsSpacedString()}", new Font("Arial", 8f), new SolidBrush(Color.Black), X + 5, currY);
            currY += 13;
            graphics.DrawString($"Prohlídka: {_horse.GetVisitPrice().ToThousandsSpacedString()}", new Font("Arial", 8f), new SolidBrush(Color.Black), X + 5, currY);
            currY += 23;
            graphics.DrawString($"Jeden dostih: {_horse.GetRaceVisitPrice(1).ToThousandsSpacedString()}", new Font("Arial", 8f), new SolidBrush(Color.Black), X + 5, currY);
            currY += 13;
            graphics.DrawString($"Dva dostihy: {_horse.GetRaceVisitPrice(2).ToThousandsSpacedString()}", new Font("Arial", 8f), new SolidBrush(Color.Black), X + 5, currY);
            currY += 13;
            graphics.DrawString($"Tri dostihy: {_horse.GetRaceVisitPrice(3).ToThousandsSpacedString()}", new Font("Arial", 8f), new SolidBrush(Color.Black), X + 5, currY);
            currY += 13;
            graphics.DrawString($"Ctyri dostihy: {_horse.GetRaceVisitPrice(4).ToThousandsSpacedString()}", new Font("Arial", 8f), new SolidBrush(Color.Black), X + 5, currY);
            currY += 23;
            graphics.DrawString($"Hlavni dostih: {_horse.GetRaceVisitPrice(5).ToThousandsSpacedString()}", new Font("Arial", 8f), new SolidBrush(Color.Black), X + 5, currY);

            currY += 13;
            currY += 13;
            graphics.DrawString($"Cena dostihu: {_horse.GetRacePrice().ToThousandsSpacedString()}", new Font("Arial", 8f), new SolidBrush(Color.Black), X + 5, currY);
            currY += 13;
            graphics.DrawString($"Cena h. dostihu: {_horse.GetMainRacePrice().ToThousandsSpacedString()}", new Font("Arial", 8f), new SolidBrush(Color.Black), X + 5, currY);
        }