Demo.WindowsForms/BSE.Windows.Forms/Renderer/BseRenderer.cs

(开头部分) 39KB

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

using System.Drawing;
using System.Drawing.Text;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
using System.Diagnostics;

namespace BSE.Windows.Forms
{
    /// <summary>
    /// Draw ToolStrips using the Office 2007 themed appearance.
    /// </summary>
    public class BseRenderer : ToolStripProfessionalRenderer
    {
        #region FieldsPrivate
        private static Rectangle[] baseSizeGripRectangles;
        private static int MarginInset;
        private static Blend MenuItemBlend;
        private static Blend ButtonBlend;
        #endregion

		#region MethodsPublic
		static BseRenderer()
        {
            MarginInset = 2;
            
            // One time creation of the blend for the button gradient brush
            ButtonBlend = new Blend();
            ButtonBlend.Positions = new float[] { 0.0F, 0.1F, 0.2F, 0.5F, 1.0F };
            ButtonBlend.Factors = new float[] { 0.6F, 0.7F, 0.8F, 1.0F, 1.0F };
            // One time creation of the blend for the menuitem gradient brush
            MenuItemBlend = new Blend();
            MenuItemBlend.Positions = new float[] { 0.0F, 0.1F, 0.2F, 0.5F, 1.0F };
            MenuItemBlend.Factors = new float[] { 0.7F, 0.8F, 0.9F, 1.0F, 1.0F };

            baseSizeGripRectangles = new Rectangle[] { new Rectangle(8, 0, 2, 2), new Rectangle(8, 4, 2, 2), new Rectangle(8, 8, 2, 2), new Rectangle(4, 4, 2, 2), new Rectangle(4, 8, 2, 2), new Rectangle(0, 8, 2, 2) };
        }
        /// <summary>
        /// Initialize a new instance of the BseRenderer class.
        /// </summary>
        public BseRenderer()
            : base(new BSE.Windows.Forms.ColorTableBlack())
        {
			this.ColorTable.UseSystemColors = false;
		}
        /// <summary>
        /// Initializes a new instance of the BseRenderer class.
        /// </summary>
        /// <param name="professionalColorTable">A <see cref="BSE.Windows.Forms.ProfessionalColorTable"/> to be used for painting.</param>
        public BseRenderer(ProfessionalColorTable professionalColorTable)
            : base(professionalColorTable)
        {
        }
        #endregion

		#region MethodsProtected
        /// <summary>
        /// Raises the <see cref="System.Windows.Forms.ToolStripRenderer.RenderArrow"/> event.
        /// </summary>
        /// <param name="e">A <see cref="System.Windows.Forms.ToolStripArrowRenderEventArgs"/> that contains the event data.</param>
        protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e)
后面还有 730 行代码,解锁后查看完整代码

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

AI 解读

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

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