示例#1
0
        private TreeNode CreateShortcutCatalog(ShortcutCatalogEntity fromCat, string dbAccount)
        {
            var shortcutCatalog = EntityHelper.Create <ShortcutCatalogEntity>(dbAccount);

            shortcutCatalog.Name = fromCat.Name;
            return(shortcutCatalog);
        }
示例#2
0
        private TabItem CreateTabItem(TabControl tabControl, string header, ShortcutCatalogEntity cataEt, bool level1Style, bool isShopShortcut)
        {
            TabItem tabItem = new TabItem();

            tabItem.Header = header;
            tabItem.Tag    = new TabItemTag(cataEt, isShopShortcut);
            tabItem.xHoverSelect();
            tabItem.Style = this.GetTabStyle(level1Style, isShopShortcut);
            tabControl.Items.Add(tabItem);
            return(tabItem);
        }
示例#3
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);
        }
示例#4
0
        public override void CreateCata(TreeNode p, Window wnd, Action <TreeNode> callback, object obj = null)
        {
            ShortcutCatalogEntity cata = null;

            this.ShowWndInput(p.EntityId, wnd, null, (text) => {
                if (text.xIsNullOrEmptyOrSpace())
                {
                    return;
                }
                cata          = EntityHelper.Create <ShortcutCatalogEntity>(this.DbAccount);
                cata.ParentId = p.EntityId;
                cata.Name     = text;
                if (callback != null)
                {
                    callback(cata);
                }
            });
        }
示例#5
0
 public TabItemTag(ShortcutCatalogEntity cataEntity, bool isShopShortcut)
 {
     this.CatEntity      = cataEntity;
     this.IsShopShortcut = isShopShortcut;
 }
示例#6
0
 private bool IsCataNotEqualTo(ShortcutCatalogEntity c1, ShortcutCatalogEntity c2)
 {
     return(c1.Name != c2.Name || c1.NextId != c2.NextId || c1.PrevId != c2.PrevId || c1.ParentId != c2.ParentId);
 }