Beispiel #1
0
        protected override void OnPaint(PaintEventArgs pe)
        {
            if (presentationDataAccess == null)
            {
                base.OnPaint(pe);
                return;
            }

            try
            {
                DrawContext dc = drawContext;

                dc.Canvas.FillRectangle(dc.DefaultBackgroundBrush, pe.ClipRectangle);

                UpdateDrawContextScrollPos();

                int maxRight;
                DrawingUtils.PaintControl(drawContext, presentationDataAccess, presentationDataAccess.Selection, this.Focused,
                                          pe.ClipRectangle, out maxRight);

                backBufferCanvas.Render(pe.Graphics);

                UpdateScrollSize(dc, maxRight, pe.ClipRectangle.Height == ClientSize.Height);
            }
            catch (Exception e)
            {
                if (viewEvents != null)
                {
                    viewEvents.OnDrawingError(e);
                }
                throw;
            }

            base.OnPaint(pe);
        }
        internal void OnPaint(RectangleF dirtyRect)
        {
            if (presentationDataAccess == null)
            {
                return;
            }

            UpdateClientSize();

            drawContext.Canvas    = new LJD.Graphics();
            drawContext.ScrollPos = new Point(0,
                                              (int)(presentationDataAccess.GetFirstDisplayMessageScrolledLines() * (double)drawContext.LineHeight));

            int maxRight;

            DrawingUtils.PaintControl(drawContext, presentationDataAccess, selection, isFocused,
                                      dirtyRect.ToRectangle(), out maxRight);

            if (maxRight > viewWidth)
            {
                viewWidth = maxRight;
                UpdateInnerViewSize();
            }
        }