Example #1
0
        internal bool PrepareContextMenu()
        {
            if (LV.FocusedItem != null)
            {
                if (LV.FocusedItem.Selected)
                {
                    DoFocusedItemChanged();
                }
            }

            var panelItem   = m_Presenter.GetFocusedPanelItem(true);
            var menuVisible = false;

            if (panelItem != null)
            {
                mComp.Image = App.Images.GetSmallImage(panelItem.ImageName);
                mComp.Text  = panelItem.Name;
                var typeId = panelItem.GetType().Name;
                menuVisible = m_AddonManager.BuildMenuForPanelItemType(mComp, typeId);
                if (!menuVisible)
                {
                    mComp.DropDownItems.Clear();
                    mComp.Tag = null;
                }
                else
                {
                    m_AddonManager.SetupMenuForPanelItem(mComp, panelItem);
                }
            }
            mAfterComp.Visible = panelItem != null;
            mComp.Visible      = panelItem != null;
            return(menuVisible);
        }
Example #2
0
        private void popTop_Opening(object sender, CancelEventArgs e)
        {
            var pv = Pages.ActivePanelView as PanelView;

            if (pv == null || pInfo.CurrentItem == null)
            {
                e.Cancel = true;
                return;
            }
            e.Cancel = !m_AddonManager.BuildMenuForPanelItemType(popTop, pInfo.CurrentItem.GetType().Name);
            m_AddonManager.SetupMenuForPanelItem(popTop, pInfo.CurrentItem);
        }