Source/Rendering/Office2007SideBarPainter.cs

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Text;
using System.Drawing;

namespace DevComponents.DotNetBar.Rendering
{
    internal class Office2007SideBarPainter : SideBarPainter, IOffice2007Painter
    {
        #region IOffice2007Painter
        private Office2007ColorTable m_ColorTable = null;
        /// <summary>
        /// Gets or sets color table used by renderer.
        /// </summary>
        public Office2007ColorTable ColorTable
        {
            get { return m_ColorTable; }
            set { m_ColorTable = value; }
        }
        #endregion

        #region Internal Implementation
        public override void PaintSideBar(SideBarRendererEventArgs e)
        {
            Graphics g = e.Graphics;
            SideBar sb = e.SideBar;
            Office2007SideBarColorTable ct = m_ColorTable.SideBar;
            LinearGradientColorTable background = ct.Background;
            //if (sb.BackColor != SystemColors.Control)
            //{
            //    background.Start = sb.BackColor;
            //    background.End = Color.Empty;
            //}

            Rectangle r = new Rectangle(Point.Empty, sb.Size);
            DisplayHelp.FillRectangle(g, r, background);

            Color border = ct.Border;

            DisplayHelp.DrawRectangle(g, border, r);

            base.PaintSideBar(e);
        }

        public override void PaintSideBarPanelItem(SideBarPanelItemRendererEventArgs e)
        {
            Graphics g = e.Graphics;
            SideBarPanelItem sb = e.SideBarPanelItem;
            Office2007SideBarColorTable ct = m_ColorTable.SideBar;
            GradientColorTable stateColorTable = sb.Expanded ? ct.SideBarPanelItemExpanded : ct.SideBarPanelItemDefault;
            if (sb.IsMouseDown)
                stateColorTable = ct.SideBarPanelItemPressed;
            else if (sb.IsMouseOver)
                stateColorTable = ct.SideBarPanelItemMouseOver;

            if (!sb.BackgroundStyle.BackColor1.IsEmpty || sb.BackgroundStyle.BackgroundImage != null)
                sb.BackgroundStyle.Paint(g, sb.DisplayRectangle);

            Rectangle r = sb.PanelRect;
            Rectangle bounds = sb.DisplayRectangle;
            r.Offset(bounds.Location);
后面还有 55 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。