Ejemplo n.º 1
0
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

            if (m_Terms == null)
            {
                return;
            }
            if (m_Layout == null)
            {
                return;
            }

            IEnumerable <LayoutItem> termsToRedraw = m_Layout.GetTermsInArea(e.ClipRectangle);
            int a = termsToRedraw.Count();

            using (Graphics graphics = e.Graphics)
                using (IGraphicEngine graphicEngine =
                           new GdiGraphicEngine(graphics, this.Font.FontFamily, FontStyle.Regular, m_Palette, MinFontSize, MaxFontSize, m_MinTermWeight, m_MaxTermWeight))
                {
                    foreach (LayoutItem currentItem in termsToRedraw)
                    {
                        if (m_ItemUderMouse == currentItem)
                        {
                            graphicEngine.DrawEmphasized(currentItem);
                        }
                        else
                        {
                            graphicEngine.Draw(currentItem);
                        }
                    }
                }
        }