Source/Separator.cs

(开头部分) 4KB

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

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

namespace DevComponents.DotNetBar
{
    /// <summary>
    /// Represents the visual separator line that is displayed between items.
    /// </summary>
    [ToolboxItem(false)]
    public class Separator : BaseItem
    {
        #region Private Variables

        #endregion

        #region Constructors
        /// <summary>
        /// Creates new instance of Separator.
		/// </summary>
		public Separator():this("") {}
		/// <summary>
        /// Creates new instance of Separator and assigns the name to it.
		/// </summary>
		/// <param name="sItemName">Item name.</param>
		public Separator(string sItemName):base(sItemName) 
        {
        }
        #endregion

        #region Internal Implementation
        public override void Paint(ItemPaintArgs p)
        {
            Rectangle bounds = this.Bounds;
            if (bounds.Width < 1 || bounds.Height < 1) return;

            Color colorLine = p.Colors.ItemSeparator;
            Color colorShade = p.Colors.ItemSeparatorShade;
            Graphics g=p.Graphics;
            Rectangle r;
            if (this.Orientation == eOrientation.Vertical)
            {
                r=new Rectangle(bounds.X + _Padding.Left, bounds.Y + _Padding.Top + bounds.Height / 2, bounds.Width - _Padding.Right, 1);
                if (!colorLine.IsEmpty)
                    DisplayHelp.DrawLine(g, r.X, r.Y, r.Right, r.Y, colorLine, 1);
            }
            else
            {
                r = new Rectangle(bounds.X + _Padding.Left + bounds.Width / 2, 
                    bounds.Y + _Padding.Top, 1, bounds.Height - _Padding.Bottom);
                if (!colorLine.IsEmpty)
                    DisplayHelp.DrawLine(g, r.X, r.Y, r.X, r.Bottom, colorLine, 1);
            }

            if (!colorShade.IsEmpty)
            {
                r.Inflate(1, 1);
                DisplayHelp.DrawRectangle(g, colorShade, r);
            }
后面还有 75 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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