Source/Ribbon/Office2007DialogLauncherPainter.cs

(开头部分) 4KB

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

using System;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;
using DevComponents.DotNetBar.Rendering;


namespace DevComponents.DotNetBar
{
    internal class Office2007DialogLauncherPainter : DialogLauncherPainter, 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 Dialog Launcher Painter
        public override void PaintDialogLauncher(RibbonBarRendererEventArgs e)
        {
            Rectangle r = e.Bounds;
            Graphics g = e.Graphics;
            bool rightToLeft = (e.RibbonBar.RightToLeft == System.Windows.Forms.RightToLeft.Yes);
            Office2007DialogLauncherStateColorTable c = GetColorTable(e);

            if (!c.TopBackground.IsEmpty && !c.BottomBackground.IsEmpty)
            {
                Presentation.Rectangle pr = new Presentation.Rectangle(
                    new Presentation.ShapeBorder(c.OuterBorder), new Presentation.ShapeFill(c.TopBackground));
                pr.Padding = new Presentation.PaddingInfo(1, 1, 1, 1);
                Presentation.Rectangle prb = new Presentation.Rectangle(new Presentation.ShapeFill(c.BottomBackground));
                prb.Size.Height = r.Height / 2;
                pr.Children.Add(prb);
                prb = new Presentation.Rectangle(new Presentation.ShapeBorder(c.InnerBorder));
                pr.Children.Add(prb);
                Presentation.ShapePaintInfo pi = new Presentation.ShapePaintInfo(g, r);
                pr.Paint(pi);
            }

            Size size = new Size(8, 8);

            // Get final dialog launcher bounds
            if (rightToLeft)
                r = new Rectangle(r.X + (r.Width - size.Width) / 2, r.Y + (r.Height - size.Height) / 2, size.Width, size.Height);
            else
                r = new Rectangle(r.X + (r.Width - size.Width)/2, r.Y + (r.Height - size.Height) / 2, size.Width, size.Height);

            SmoothingMode sm = g.SmoothingMode;
            g.SmoothingMode = SmoothingMode.Default;
            
            // Create the dialog launcher shape
            Presentation.ShapeBorder border = new Presentation.ShapeBorder(c.DialogLauncherShade, 1);
后面还有 61 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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