コード例 #1
0
        public override void PaintItemSeparator(ItemContainerSeparatorRendererEventArgs e)
        {
            if (e.Item is ItemContainer)
                return;

            Graphics g = e.Graphics;
            BaseItem item = e.Item;
            Size imageSize = Size.Empty;
            if (item is ImageItem)
                imageSize = ((ImageItem)item).ImageSize;

            ItemContainer container = e.ItemContainer;
            Color color1 = m_ColorTable.LegacyColors.ItemSeparator;
            Color color2 = m_ColorTable.LegacyColors.ItemSeparatorShade;

            Point start = Point.Empty, end = Point.Empty;
            Point start2 = Point.Empty, end2 = Point.Empty;

            if (container.LayoutOrientation == eOrientation.Horizontal)
            {
                start = new Point(item.DisplayRectangle.X - 2, item.DisplayRectangle.Y + 3);
                end = new Point(start.X, item.DisplayRectangle.Bottom - 4);
                start2 = new Point(start.X + 1, start.Y);
                end2 = new Point(end.X + 1, end.Y);
            }
            else
            {
                if (item.IsOnMenu)
                {
                    start = new Point(item.DisplayRectangle.X + imageSize.Width, item.DisplayRectangle.Y - 2);
                    end = new Point(item.DisplayRectangle.Right-1, start.Y);
                    start2 = new Point(start.X, start.Y + 1);
                    end2 = new Point(end.X, end.Y + 1);
                }
                else
                {
                    start = new Point(item.DisplayRectangle.X + 3, item.DisplayRectangle.Y - 2);
                    end = new Point(item.DisplayRectangle.Right - 4, start.Y);
                    start2 = new Point(start.X, start.Y + 1);
                    end2 = new Point(end.X, end.Y + 1);
                }
            }

            DisplayHelp.DrawLine(g, start, end, color1, 1);
            DisplayHelp.DrawLine(g, start2, end2, color2, 1);
        }
コード例 #2
0
 public abstract void PaintItemSeparator(ItemContainerSeparatorRendererEventArgs e);