예제 #1
0
        public override void Render(ref PdfSharp.Drawing.XGraphics gfx, double offsetLeft, double offsetTop, double scaleX, double scaleY)
        {
            PreRender(ref gfx, offsetLeft, offsetTop, scaleX, scaleY);
            XRect rectangle = new XRect(
                Util.MillimeterToPoint(offsetLeft + Left),
                Util.MillimeterToPoint(offsetTop + Top),
                Util.MillimeterToPoint(Width * scaleX),
                Util.MillimeterToPoint(Height * scaleY));

            if (BindingOption == SpecialBinding.PageNumber)
            {
                PrintableComponent pc = Parent;
                while (pc != null && !(pc is PrintablePage))
                {
                    pc = pc.Parent;
                }

                if (pc != null)
                {
                    text = ((PrintablePage)pc).PageNumber.ToString();
                }
            }

            if (text != null && text != "Null")
            {
                XTextFormatter xtf = new XTextFormatter(gfx);
                xtf.Alignment = Style.FontAlignment;

                xtf.DrawString(text, Style.AsXFont(), (XBrush) new SolidBrush(Style.PrimaryColor), rectangle);
            }
            base.Render(ref gfx, offsetLeft, offsetTop, scaleX, scaleY);
        }
예제 #2
0
 public void AddChild(PrintableComponent pc)
 {
     Children.Add(pc);
     pc.Parent = this;
 }