Exemple #1
0
 public AddBookmarkItemViewModel(Authentication authentication, string name, string[] targetPaths)
 {
     this.Validate(name, targetPaths);
     this.authentication = authentication;
     this.ItemName       = name;
     this.items          = TreeViewItemViewModelBuilder.MakeItemList(targetPaths);
     this.TargetPaths    = TreeViewItemViewModelBuilder.MakeItemList(targetPaths, true);
     this.targetPath     = this.TargetPaths.First();
     this.DisplayName    = Properties.Resources.Title_AddBookmark;
 }
        internal void UpdateBookmarkItems()
        {
            var items = TreeViewItemViewModelBuilder.MakeItemList(this.bookmarks.ToArray());

            this.bookmarks.Clear();
            foreach (var item in items)
            {
                this.bookmarks.Add(item);
            }
        }
 public MoveBookmarkItemViewModel(IServiceProvider serviceProvider, string currentPath, string[] itemPaths)
     : base(serviceProvider, currentPath: currentPath, targetPaths: TreeViewItemViewModelBuilder.MakeItemList(itemPaths, true))
 {
     this.itemPaths = itemPaths;
     if (NameValidator.VerifyCategoryPath(currentPath) == true)
     {
         this.currentName = new CategoryName(currentPath).Name + PathUtility.Separator;
     }
     else
     {
         this.currentName = new ItemName(currentPath).Name;
     }
 }
        internal void UpdateBookmarkItems()
        {
            var items = TreeViewItemViewModelBuilder.MakeItemList(this.bookmarks.ToArray());

            this.bookmarks.Clear();
            foreach (var item in items)
            {
                this.bookmarks.Add(item);
            }
            //this.bookmarks.ToArray();
            //var category = this.browser.Value.BookmartCategory;
            //this.bookmarks.Clear();
            //var items = EnumerableUtility.Descendants<TreeViewItemViewModel>(category, item => item.ItemsSource);

            //foreach (var item in items)
            //{
            //    if (item is BookmarkCategoryTreeViewItemViewModel categoryViewModel)
            //    {
            //        this.bookmarks.Add(categoryViewModel.Path);
            //    }
            //    else if (item is TableTreeViewItemViewModel tableVieWModel)
            //    {
            //        string szPath = PathUtility.Separator + tableVieWModel.TableName;
            //        if (tableVieWModel.Parent is BookmarkCategoryTreeViewItemViewModel bookmarkCategoryTreeViewModel)
            //        {
            //            szPath = bookmarkCategoryTreeViewModel.Path + tableVieWModel.TableName;
            //        }

            //        this.bookmarks.Add(szPath);
            //    }
            //    else if (item is InvalidTreeViewItemViewModel invalidViewModel)
            //    {
            //        this.bookmarks.Add(invalidViewModel.Path);
            //    }
            //}
        }