Source/Rendering/Office2007ColorItemPainter.cs

(开头部分) 3KB

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

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


namespace DevComponents.DotNetBar.Rendering
{
    /// <summary>
    /// Represents the painter for ColorItem in Office 2007 style
    /// </summary>
    internal class Office2007ColorItemPainter : ColorItemPainter, IOffice2007Painter
    {
        #region IOffice2007Painter
        private Office2007ColorTable m_ColorTable = null; //new Office2007ColorTable();

        /// <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 PaintColorItem(ColorItemRendererEventArgs e)
        {
            Graphics g = e.Graphics;
            ColorItem item = e.ColorItem;
            Rectangle r = item.Bounds;
            Color borderColor = m_ColorTable.ColorItem.Border;
            Color outerHotColor = m_ColorTable.ColorItem.MouseOverOuterBorder;
            Color innerHotColor = m_ColorTable.ColorItem.MouseOverInnerBorder;

            System.Drawing.Drawing2D.SmoothingMode sm = g.SmoothingMode;
            g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.Default;

            Region clip = g.Clip;
            g.SetClip(r);
            Color selectedColor = Color.Empty;
            ColorPickerDropDown cpd = null;
            BaseItem parent = item.Parent;
            while (parent != null)
            {
                if (parent is ColorPickerDropDown)
                {
                    cpd = parent as ColorPickerDropDown;
                    break;
                }
                parent = parent.Parent;
            }
            if (cpd != null)
                selectedColor = cpd.SelectedColor;
            try
            {
                if (!item.Color.IsEmpty)
                {
                    Rectangle fill = r;
                    fill.Inflate(1, 1);
后面还有 43 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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