Source/ContextMenuBar.cs

(开头部分) 13KB

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

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

namespace DevComponents.DotNetBar
{
    /// <summary>
    /// Represents the context menu bar that provides the context menus for the System.Windows.Forms.Control inherited controls on the form.
    /// </summary>
    [ToolboxItem(true), Designer(typeof(Design.ContextMenuBarDesigner)), ProvideProperty("ContextMenuEx", typeof(Control)), System.Runtime.InteropServices.ComVisible(false), DefaultEvent("ItemClick")]
    public class ContextMenuBar : Bar, System.ComponentModel.IExtenderProvider
    {
        #region Private Variables
        private Hashtable m_ContextExMenus = new Hashtable();
        private Hashtable m_ContextExHandlers = new Hashtable();
        private bool m_ContextMenuSubclass = true;
        #endregion

        #region Internal Implementation
        public ContextMenuBar() : base()
        {
            this.Visible = false;
            this.WrapItemsDock = true;
            this.WrapItemsFloat = true;
        }

        protected override bool IsContextPopup(BaseItem popup)
        {
            if (this.Items.Contains(popup)) return true;
            return base.IsContextPopup(popup);
        }
        #endregion

        #region Property Hiding
        /// <summary>
        /// Gets/Sets whether Bar is visible or not.
        /// </summary>
        [DevCoBrowsable(false), Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public new bool Visible
        {
            get { return base.Visible; }
            set { base.Visible = value; }
        }
        #endregion

        #region Extender Implementation
        // *********************************************************************
        //
        // Extended Property ContextMenuEx implementation code
        //
        // *********************************************************************
        bool IExtenderProvider.CanExtend(object target)
        {
            if (target is Control)
                return true;
            return false;
        }
后面还有 286 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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