public DemoTreeNode(DemoCode demo) : base(demo.CodeTitle) { this.Demo = demo; this.SelectedImageKey = "folder"; this.ImageKey = "folder"; }
private CategoryTreeNode LeaftCategory(DemoCode demo) { var categories = demo.Category.Split('/'); CategoryTreeNode previous = null; foreach (var categ in categories) { CategoryTreeNode categNode; if (!mCategories.TryGetValue(categ, out categNode)) { categNode = new CategoryTreeNode(categ); if (previous == null) this.Nodes.Add(categNode); else previous.Nodes.Add(categNode); mCategories.Add(categ, categNode); } previous = categNode; } return previous; }