Source/CrumbBar/CrumbBarItemView.cs

(开头部分) 7KB

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

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

namespace DevComponents.DotNetBar
{
    /// <summary>
    /// Represents a view of CrumbBarItem displayed inside of CrumbBar control.
    /// </summary>
    internal class CrumbBarItemView : ButtonItem
    {
        #region Internal Implementation
        /// <summary>
        /// Initializes a new instance of the CrumbBarItemView class.
        /// </summary>
        public CrumbBarItemView():base()
        {
            this.SubItemsExpandWidth = 15;
            this.HorizontalPadding = 2;
        }

        private CrumbBarItem _AttachedItem;
        public CrumbBarItem AttachedItem
        {
            get { return _AttachedItem; }
            set
            {
                if (_AttachedItem != null)
                {
                    _AttachedItem.TextChanged -= new EventHandler(AttachedItemTextChanged);
                    _AttachedItem.SubItemsChanged -= new System.ComponentModel.CollectionChangeEventHandler(AttachedItemSubItemsChanged);
                    _AttachedItem.PopupClose -= new EventHandler(AttachedItemPopupClose);
                }
                _AttachedItem = value;

                if (_AttachedItem != null)
                {
                    this.Text = _AttachedItem.Text;
                    this.Cursor = _AttachedItem.Cursor;
                    this.ForeColor = _AttachedItem.ForeColor;
                    this.HotForeColor = _AttachedItem.HotForeColor;
                    this.Tooltip = _AttachedItem.Tooltip;

                    _AttachedItem.TextChanged += new EventHandler(AttachedItemTextChanged);
                    _AttachedItem.SubItemsChanged += new System.ComponentModel.CollectionChangeEventHandler(AttachedItemSubItemsChanged);
                    _AttachedItem.PopupClose += new EventHandler(AttachedItemPopupClose);
                    if (AnyVisibleItems)
                        this.PopupType = ePopupType.Container;
                    else
                        this.PopupType = ePopupType.Menu;
                }
                else
                    this.PopupType = ePopupType.Menu;
            }
        }

        private DateTime _PopupCloseTime = DateTime.MinValue;
        private void AttachedItemPopupClose(object sender, EventArgs e)
        {
后面还有 172 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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