private TreeNode CreateShortcutCatalog(ShortcutCatalogEntity fromCat, string dbAccount) { var shortcutCatalog = EntityHelper.Create <ShortcutCatalogEntity>(dbAccount); shortcutCatalog.Name = fromCat.Name; return(shortcutCatalog); }
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); }
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); }
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); } }); }
public TabItemTag(ShortcutCatalogEntity cataEntity, bool isShopShortcut) { this.CatEntity = cataEntity; this.IsShopShortcut = isShopShortcut; }
private bool IsCataNotEqualTo(ShortcutCatalogEntity c1, ShortcutCatalogEntity c2) { return(c1.Name != c2.Name || c1.NextId != c2.NextId || c1.PrevId != c2.PrevId || c1.ParentId != c2.ParentId); }