Exemplo n.º 1
0
 protected override void DrawItemString(Graphics g, object item, Font font, Brush brush, Rectangle bounds, StringFormat sf, int index)
 {
     if (index >= 0)
     {
         string    displayName;
         string    description;
         Rectangle rectangle = bounds;
         if (!base.DesignMode)
         {
             CStyleItem item2 = (CStyleItem)item;
             displayName = item2.GetDisplayName();
             description = item2.GetDescription();
             Bitmap icon = item2.GetIcon();
             if (icon != null)
             {
                 g.DrawImage(icon, 2, rectangle.Top + 2);
             }
         }
         else
         {
             displayName = item.ToString();
             description = item.ToString();
         }
         if (this.TerminateEnd && !base.DesignMode)
         {
             int terminate = this.GetTerminate();
             if ((index > terminate) && (terminate >= 0))
             {
                 brush = Brushes.Gray;
             }
         }
         base.DrawItemString(g, displayName, this.Font, brush, bounds, sf, index);
         g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
         sf.FormatFlags     -= 0x1000;
         bounds.Y           += ((int)this.Font.GetHeight()) + 2;
         bounds.Height       = this.ItemHeight - ((((int)this.Font.GetHeight()) + 2) + 2);
         base.DrawItemString(g, description, this.HelpFont, new SolidBrush(this.HelpForeColor), bounds, sf, index);
     }
 }
Exemplo n.º 2
0
 protected override void DrawItemString(Graphics g, object item, Font font, Brush brush, Rectangle bounds, StringFormat sf, int index)
 {
     if (index >= 0)
     {
         string nameAndState;
         if (!base.DesignMode)
         {
             CStyleItem item2 = (CStyleItem)item;
             nameAndState = item2.NameAndState;
             item2.GetDescription();
         }
         else
         {
             nameAndState = item.ToString();
             item.ToString();
         }
         int terminate = this.GetTerminate();
         if ((index > terminate) && (terminate >= 0))
         {
             brush = Brushes.Gray;
         }
         base.DrawItemString(g, nameAndState, font, brush, bounds, sf, index);
     }
 }