public override void Initialize(IComponent component)
 {
     base.Initialize(component);
     //
     this.m_BaseItemStackItem = base.Component as BaseItemStackItem;
     if (this.m_BaseItemStackItem == null)
     {
         GISShare.Controls.WinForm.WFNew.Forms.TBMessageBox.Show("BaseItemStackItem == null");
         return;
     }
 }
 private bool SelectCompnentMouseUp_DG(BaseItemStackItem ribbonBaseItemStackItem, Point point)
 {
     if (ribbonBaseItemStackItem == null)
     {
         return(false);
     }
     //
     foreach (BaseItem one in ribbonBaseItemStackItem.BaseItems)
     {
         if (this.SelectCompnentMouseUp(one as RibbonGalleryItem, point))
         {
             return(true);
         }
         if (this.SelectCompnentMouseUp(one as ButtonGroupItem, point))
         {
             return(true);
         }
         if (this.SelectCompnentMouseUp_DG(one as BaseItemStackExItem, point))
         {
             return(true);
         }
         if (this.SelectCompnentMouseUp_DG(one as BaseItemStackItem, point))
         {
             return(true);
         }
         if (this.SelectCompnentMouseUp_DG(one as CanvasItem, point))
         {
             return(true);
         }
         //
         if (one.DesignMouseClickRectangleContainsEx(point))
         {
             ISelectionService pSelectionService = GetService(typeof(ISelectionService)) as ISelectionService;
             if (pSelectionService != null)
             {
                 this.m_Item2 = one;
                 if (ribbonBaseItemStackItem.BaseItems.ExchangeItem(this.m_Item1, this.m_Item2))
                 {
                     pSelectionService.SetSelectedComponents(new Component[] { this.m_Item1 as Component }, SelectionTypes.Primary);
                     this.m_DescriptionMenuPopupPanel.Refresh();
                     return(true);
                 }
                 else
                 {
                     pSelectionService.SetSelectedComponents(new Component[] { one as Component }, SelectionTypes.Primary);
                     this.m_DescriptionMenuPopupPanel.Refresh();
                     return(true);
                 }
             }
         }
     }
     //
     return(false);
 }
 private bool SelectCompnentMouseDown_DG(BaseItemStackItem ribbonBaseItemStackItem, Point point)
 {
     if (ribbonBaseItemStackItem == null)
     {
         return(false);
     }
     //
     foreach (BaseItem one in ribbonBaseItemStackItem.BaseItems)
     {
         if (this.SelectCompnentMouseDown(one as RibbonGalleryItem, point))
         {
             return(true);
         }
         if (this.SelectCompnentMouseDown(one as ButtonGroupItem, point))
         {
             return(true);
         }
         if (this.SelectCompnentMouseDown_DG(one as RibbonBarItem, point))
         {
             return(true);
         }
         if (this.SelectCompnentMouseDown_DG(one as BaseItemStackItem, point))
         {
             return(true);
         }
         if (this.SelectCompnentMouseDown_DG(one as CanvasItem, point))
         {
             return(true);
         }
         //
         if (one.DesignMouseClickRectangleContainsEx(point))
         {
             ISelectionService pSelectionService = GetService(typeof(ISelectionService)) as ISelectionService;
             if (pSelectionService != null)
             {
                 this.m_Item1 = one;
                 pSelectionService.SetSelectedComponents(new Component[] { one as Component }, SelectionTypes.Primary);
                 this.m_RibbonPage.Refresh();
                 return(true);
             }
         }
     }
     //
     return(false);
 }