Exemple #1
0
        private void ReloadTabItemData(TabItem tabItem, string targetNodeId = null)
        {
            TabItemTag tag   = this.GetTag(tabItem);
            var        catEt = tag.CatEntity;

            if (catEt != null)
            {
                var ctv = new CtlTreeView();
                ctv.CollapseSearch();
                if (tag.IsShopShortcut)
                {
                    TreeNode showFrom = catEt;
                    var      entityId = catEt.EntityId;
                    ctv.Init(_pubTvController, null, null, false, entityId == ((_pubTvController != null) ? _pubTvController.DbAccessor.Root.EntityId : null), targetNodeId, showFrom, this.CanEditShortCut);
                }
                else
                {
                    var showFrom = catEt;
                    var entityId = catEt.EntityId;
                    ctv.Init(_prvTvController, null, null, false, entityId == ((_prvTvController != null) ? _prvTvController.DbAccessor.Root.EntityId : null), targetNodeId, showFrom, this.CanEditShortCut);
                }
                this.BindEvent(ctv, true);
                this.SetTooltip(ctv);
                tabItem.Content = ctv;
            }
        }
Exemple #2
0
        private TabItemTag FindRootTabItemTag(CtlTreeView ctv)
        {
            TabItemTag tag = null;

            if (ctv != null)
            {
                tag = (ctv.xFindAncestor <TabItem>().Tag as TabItemTag);
            }
            return(tag);
        }
Exemple #3
0
        private bool IsInsidePrvTabItem(CtlTreeView ctv)
        {
            bool rt;

            if (this.grdSearch.IsVisible)
            {
                rt = (this._prvSearchMouseDownTime > this._pubSearchMouseDownTime);
            }
            else
            {
                TabItemTag tag = this.FindRootTabItemTag(ctv);
                rt = !tag.IsShopShortcut;
            }
            return(rt);
        }
Exemple #4
0
        private TabItem FindCatalogTabItemById(TabControl tab, string cateId)
        {
            TabItem tabItem = null;

            foreach (TabItem item in tab.Items)
            {
                TabItemTag            tabItemTag = item.Tag as TabItemTag;
                ShortcutCatalogEntity catEntity  = tabItemTag.CatEntity;
                if (catEntity.EntityId == cateId)
                {
                    tabItem = item;
                    break;
                }
            }
            return(tabItem);
        }
Exemple #5
0
 private ShortcutTreeviewController GetShortcutTreeviewController(TabItemTag tag)
 {
     return(tag.IsShopShortcut ? this._pubTvController : this._prvTvController);
 }