IBaseItemDB ICustomize.AddCustomizeBaseItemEx(int index, IBaseItemDB pBaseItem)
        {
            if (pBaseItem == null)
            {
                return(null);
            }
            if (index < 0)
            {
                index = 0;
            }
            if (index > this.Items.Count)
            {
                index = this.Items.Count;
            }
            //
            ToolStripItem      item               = null;
            ButtonItem         buttonItem         = pBaseItem as ButtonItem;
            SplitButtonItem    splitButtonItem    = pBaseItem as SplitButtonItem;
            DropDownButtonItem dropDownButtonItem = pBaseItem as DropDownButtonItem;

            if (buttonItem != null)
            {
                item = buttonItem.CloneToMenuItem() as ToolStripItem;
            }
            else if (splitButtonItem != null)
            {
                item = splitButtonItem.CloneToMenuItem() as ToolStripItem;
            }
            else if (dropDownButtonItem != null)
            {
                item = dropDownButtonItem.CloneToMenuItem() as ToolStripItem;
            }
            else
            {
                item = pBaseItem.Clone() as ToolStripItem;
            }
            if (item == null)
            {
                return(item as IBaseItemDB);
            }
            this.m_CustomizeBaseItems.Add(item);
            this.DropDownItems.Insert(index, item);
            //
            return(item as IBaseItemDB);
        }
        public virtual ToolStripItem CloneToSplitButtonItem()
        {
            SplitButtonItem item = new SplitButtonItem();

            item.Category              = this.Category;
            item.Name                  = this.Name + "[GUID]" + System.Guid.NewGuid().ToString();
            item.Text                  = this.Text;
            item.DisplayStyle          = this.DisplayStyle;
            item.ImageAlign            = this.ImageAlign;
            item.ImageIndex            = this.ImageIndex;
            item.ImageKey              = this.ImageKey;
            item.ImageScaling          = this.ImageScaling;
            item.ImageTransparentColor = this.ImageTransparentColor;
            item.TextImageRelation     = this.TextImageRelation;
            if (this.Image != null)
            {
                item.Image = this.Image.Clone() as Image;
            }
            item.ToolTipText           = this.ToolTipText;
            item.Tag                   = this.Tag;
            item.BackgroundImage       = this.BackgroundImage;
            item.BackgroundImageLayout = this.BackgroundImageLayout;
            item.BackColor             = this.BackColor;
            //item.CheckOnClick = this.CheckOnClick;
            item.DoubleClickEnabled   = this.DoubleClickEnabled;
            item.DropDownClosed      += new EventHandler(item_DropDownClosed);
            item.DropDownItemClicked += new ToolStripItemClickedEventHandler(item_DropDownItemClicked);
            item.DropDownOpened      += new EventHandler(item_DropDownOpened);
            //item.CheckedChanged += new EventHandler(item_CheckedChanged);
            item.Click          += new EventHandler(item_Click);
            item.EnabledChanged += new EventHandler(item_EnabledChanged);
            item.MouseDown      += new MouseEventHandler(item_MouseDown);
            //item.MouseEnter += new EventHandler(item_MouseEnter);
            //item.MouseHover += new EventHandler(item_MouseHover);
            //item.MouseLeave += new EventHandler(item_MouseLeave);
            item.MouseMove      += new MouseEventHandler(item_MouseMove);
            item.MouseUp        += new MouseEventHandler(item_MouseUp);
            item.VisibleChanged += new EventHandler(item_VisibleChanged);
            return(item);
        }