123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- using System.Drawing;
- using FastReport.Utils;
- namespace FastReport.Design
- {
- internal class LastFormatting
- {
- private Border border;
- private FillBase fill;
- private Font font;
- private HorzAlign horzAlign;
- private VertAlign vertAlign;
- private FillBase textFill;
- private int angle;
- public Border Border
- {
- get { return border; }
- set { border = value; }
- }
- public FillBase Fill
- {
- get { return fill; }
- set { fill = value; }
- }
- public Font Font
- {
- get { return font; }
- set { font = value; }
- }
- public HorzAlign HorzAlign
- {
- get { return horzAlign; }
- set { horzAlign = value; }
- }
- public VertAlign VertAlign
- {
- get { return vertAlign; }
- set { vertAlign = value; }
- }
- public FillBase TextFill
- {
- get { return textFill; }
- set { textFill = value; }
- }
- public int Angle
- {
- get { return angle; }
- set { angle = value; }
- }
- public void SetFormatting(ReportComponentBase c)
- {
- if (Config.DisableLastFormatting)
- return;
- if (c != null)
- {
- if (Border != null && c.FlagUseBorder)
- c.Border = Border.Clone();
- if (c.FlagUseFill)
- c.Fill = Fill.Clone();
- }
- if (c is TextObject)
- {
- TextObject c1 = c as TextObject;
- if (Font != null)
- c1.Font = Font;
- c1.HorzAlign = HorzAlign;
- c1.VertAlign = VertAlign;
- c1.TextFill = TextFill.Clone();
- c1.Angle = Angle;
- }
- }
- public LastFormatting()
- {
- Border = new Border();
- Fill = new SolidFill();
- TextFill = new SolidFill(Color.Black);
- Font = Config.DesignerSettings.DefaultFont;
- }
- }
- }
|