示例#1
0
        public void DrawDiscoverContentPane(System.Drawing.Graphics graphics, System.Drawing.Rectangle bounds, System.Windows.Forms.DrawItemState state, DiscoverPane pane, System.Drawing.Font font, bool rtl)
        {
            int num1 = 5;

            bounds.Inflate(-7, 0);
            Rectangle imgRect    = Rectangle.Empty;
            Rectangle rectangle2 = bounds;

            if (rtl)
            {
                if (pane.LargeImage != null)
                {
                    imgRect = new Rectangle(bounds.Right - pane.LargeImage.Width, (bounds.Top
                                                                                   + (bounds.Height / 2)) - (pane.LargeImage.Height / 2), pane.LargeImage.Width,
                                            pane.LargeImage.Height);
                    rectangle2.Width -= (pane.LargeImage.Width + num1);
                }
            }
            else if (pane.LargeImage != null)
            {
                imgRect = new Rectangle(bounds.Left, (bounds.Top + (bounds.Height / 2))
                                        - (pane.LargeImage.Height / 2), pane.LargeImage.Width, pane.LargeImage.Height);
                rectangle2.X     += (pane.LargeImage.Width + num1);
                rectangle2.Width -= (pane.LargeImage.Width + num1);
            }
            if (imgRect != Rectangle.Empty)
            {
                Image image1 = pane.LargeImage;
                if ((state & DrawItemState.Disabled) == DrawItemState.Disabled)
                {
                    graphics.DrawImage(image1, imgRect, 0, 0, image1.Width, image1.Height,
                                       GraphicsUnit.Pixel, new System.Drawing.Imaging.ImageAttributes()); //TODO:ImageAttributes
                }
                else
                {
                    graphics.DrawImage(image1, imgRect);
                }
            }
            using (StringFormat strFormat = new StringFormat(StringFormat.GenericTypographic))
            {
                strFormat.Trimming      = StringTrimming.EllipsisCharacter;
                strFormat.FormatFlags  |= StringFormatFlags.NoWrap;
                strFormat.LineAlignment = StringAlignment.Center;
                strFormat.HotkeyPrefix  = HotkeyPrefix.Show;
                if (rtl)
                {
                    strFormat.FormatFlags |= StringFormatFlags.DirectionRightToLeft;
                }
                if ((state & DrawItemState.Disabled) == DrawItemState.Disabled)
                {
                    graphics.DrawString(pane.Text, font, SystemBrushes.ControlDark,
                                        (RectangleF)rectangle2, strFormat);
                }
                else
                {
                    using (SolidBrush stringBrush = new SolidBrush(((state & DrawItemState.Selected) ==
                                                                    DrawItemState.Selected) ? this.BorderColor : pane.ForeColor)) //TODO:this.BorderColor
                    {
                        graphics.DrawString(pane.Text, font, stringBrush, (RectangleF)rectangle2, strFormat);
                    }
                }
            }
        }
示例#2
0
        public void DrawDiscoverFooterPane(System.Drawing.Graphics graphics, System.Drawing.Rectangle bounds, System.Windows.Forms.DrawItemState state, DiscoverPane pane, System.Drawing.Font font)
        {
            Rectangle imgBounds = new Rectangle((bounds.X + (bounds.Width / 2)) - 8,
                                                (bounds.Y + (bounds.Height / 2)) - 8, 0x10, 0x10);
            Image drawImage = (pane.SmallImage != null) ? pane.SmallImage : pane.LargeImage;

            if (drawImage != null)
            {
                if ((state & DrawItemState.Disabled) == DrawItemState.Disabled)
                {
                    graphics.DrawImage(drawImage, imgBounds, 0, 0, drawImage.Width, drawImage.Height, GraphicsUnit.Pixel,
                                       new System.Drawing.Imaging.ImageAttributes());//TODO: ImageAttributes
                }
                else
                {
                    graphics.DrawImage(drawImage, imgBounds);
                }
            }
        }
示例#3
0
 public void DrawDiscoverFooterPaneBackground(System.Drawing.Graphics graphics, System.Drawing.Rectangle bounds, System.Windows.Forms.DrawItemState itemState)
 {
     if (itemState != DrawItemState.None)
     {
         _DrawFooterPaneBackground(graphics, bounds, itemState);
     }
 }
示例#4
0
        public void DrawDiscoverContentPaneBackground(System.Drawing.Graphics graphics, System.Drawing.Rectangle bounds, System.Windows.Forms.DrawItemState state)
        {
            this._DrawFooterPaneBackground(graphics, bounds, state);

            using (Pen pen1 = new Pen(this.BorderColor))
            {
                graphics.DrawLine(pen1, bounds.X, bounds.Y, bounds.Right, bounds.Y);
            }
        }