protected override void DoInit() { titleContent = new GUIContent(GetTitle()); var all = new SimpleAll(); data = all; ABAssetinfos assetInfos = new ABAssetinfos(); assetInfos.LoadFromCsv(GetLoadCsvFile()); var tab = new SimpleTab(assetInfos.sumStr); all.tabs.Add(tab); foreach (var ai in assetInfos.sortedAllAssetInfos) { var nodename = ai.asset + ", cnt=" + ai.containingABs.Count + ", mem=" + ToolUtils.readableSize(ai.memSize) + ", cansave=" + ToolUtils.readableSize(ai.canSaveMemSize); var node = new SimpleNode(nodename, ai.containingABs) { attach = ai }; tab.nodes.Add(node); } }
/// <summary> /// 标签鼠标停留 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void MenuSelect(object sender, EventArgs e) { SimpleTab tab = (SimpleTab)sender; foreach (Control item in spc.Panel1.Controls) { SimpleTab t = (SimpleTab)item; t.SetActive(item.Equals(tab)); } LoadDir(tab._dir); }
/// <summary> /// 加载标签 /// </summary> private void InitInvocations() { DirectoryInfo first = Settings.sorter[0]; List <DirectoryInfo> temp = new List <DirectoryInfo>(Settings.sorter); temp.Reverse(); foreach (DirectoryInfo dir in temp) { SimpleTab tab = new SimpleTab(dir.Name, dir); tab.MouseEnter += new EventHandler(MenuSelect); tab.SetActive(dir.Equals(first)); spc.Panel1.Controls.Add(tab); } LoadDir(first); }
protected override void DoInit() { SimpleAll adata = new SimpleAll(); var t = new SimpleTab("iamtab"); var t2 = new SimpleTab("iamtab"); var n = new SimpleNode("iamnode", new List <string> { "aa", "bb", "i am a leaf", "i am too" }); var n2 = new SimpleNode("iamnode2", new List <string> { "cc", "dd", "i am a leaf", "i am too" }); t.nodes.Add(n); t.nodes.Add(n2); t.nodes.Add(n); t2.nodes.Add(new SimpleNode("bbb")); adata.tabs.Add(t); adata.tabs.Add(t); adata.tabs.Add(t2); data = adata; }