示例#1
0
        private void AddTreeLeaves(ICategory[] getAllCategories, List <ICategory> flatTree,
                                   ICategory category)
        {
            var children = getAllCategories.Where(x => x.Parent?.Id == category.Id);

            foreach (var child in children)
            {
                category.AddChild(child);
                flatTree.Add(child);
                AddTreeLeaves(getAllCategories, flatTree, child);
            }
        }
示例#2
0
 public void AddChild(ICategory parent, string childName)
 {
     parent.AddChild(new Category(childName));
 }
示例#3
0
 private void OnAddLinkItem(ICategory toCategory)
 {
     var linkItem = new Link();
     var dialogManager = _container.Resolve<IDialogManager<Link>>();
     if (dialogManager.ShowAddDialog(linkItem) == true)
     {
         toCategory.AddChild(linkItem);
     }
 }
示例#4
0
 private void OnAddCategoryItem(ICategory toCategory)
 {
     var category = new Category();
     var dialogManager = _container.Resolve<IDialogManager<Category>>();
     if (dialogManager.ShowAddDialog(category) != true) return;
     if (toCategory != null)
         toCategory.AddChild(category);
     else _treeViewModel.Categories.Add(category);
 }