private void Render(Graphics TempGraphics)
        {
            Rectangle pageBounds = this.PageBounds;

            TempGraphics.Clear(this.BackColor);
            if (!this.PageBounds.Size.Equals((object)Size.Empty))
            {
                if (pageBounds.Y < this.Margin.Top)
                {
                    pageBounds.Height = pageBounds.Height + pageBounds.Y;
                }
                Brush brush = (Brush) new SolidBrush(this._bgColor);
                TempGraphics.FillRectangle(brush, pageBounds);
            }
            if (this.PaintControl != null)
            {
                this.PaintControl((object)this, TempGraphics);
            }
            if (this.PageBounds.Size.Equals((object)Size.Empty))
            {
                return;
            }
            if (this._drawRect)
            {
                Pen pen = new Pen(this._rectColor);
                TempGraphics.DrawRectangle(pen, pageBounds);
            }
            if (!this.DrawShadow)
            {
                return;
            }
            ShadowDrawing.DrawShadow(TempGraphics, pageBounds);
        }
示例#2
0
        private void Render(Graphics TempGraphics)
        {
            Rectangle page = PageBounds;

            //Clear with backcolor
            TempGraphics.Clear(BackColor);

            //Draw page background
            if (!PageBounds.Size.Equals(Size.Empty))
            {
                if (page.Y < Margin.Top)
                {
                    page.Height = page.Height + page.Y;
                }
                if (page.X < Margin.Left)
                {
                    page.Width = page.Width + page.X;
                }
                Brush bg = new SolidBrush(_bgColor);
                TempGraphics.FillRectangle(bg, page);
            }

            //Custom Paint!
            if (PaintControl != null)
            {
                PaintControl.Invoke(this, CurrentView, PageLocation, TempGraphics);
            }

            if (!PageBounds.Size.Equals(Size.Empty))
            {
                if (_drawRect)
                {
                    Pen mp = new Pen(_rectColor);
                    //Draw page margin
                    TempGraphics.DrawRectangle(mp, page);
                }

                if (DrawShadow)
                {
                    //Draw a Shadow
                    ShadowDrawing.DrawShadow(TempGraphics, page);
                }
            }
        }