Esempio n. 1
0
        public virtual bool GoFolderUp()
        {
            if (this.FolderRootNode == null || FolderService.IsOfflineRootFolder(FolderRootNode.NodePath))
            {
                return(false);
            }

            DirectoryInfo parentNode = (new DirectoryInfo(this.FolderRootNode.NodePath)).Parent;

            if (parentNode == null)
            {
                return(false);
            }

            this.FolderRootNode = new OfflineFolderNodeViewModel(parentNode, ChildNodes);

            LoadChildNodes();

            return(true);
        }
Esempio n. 2
0
        public void BuildBreadCrumbs()
        {
            this.BreadCrumbs.Clear();

            // Top root nodes have no breadcrumbs
            if (this.FolderRootNode == null ||
                FolderService.IsOfflineRootFolder(this.FolderRootNode.NodePath))
            {
                return;
            }

            this.BreadCrumbs.Add((IBaseNode)this.FolderRootNode);

            DirectoryInfo parentNode = (new DirectoryInfo(this.FolderRootNode.NodePath)).Parent;

            while ((parentNode != null) && !FolderService.IsOfflineRootFolder(parentNode.FullName))
            {
                this.BreadCrumbs.Insert(0, (IBaseNode) new OfflineFolderNodeViewModel(parentNode));
                parentNode = (new DirectoryInfo(parentNode.FullName)).Parent;
            }
        }
Esempio n. 3
0
        public void Create(OfflineFolderViewModel folder)
        {
            this.Items.Clear();

            // Top root nodes have no breadcrumbs
            if (folder.FolderRootNode == null ||
                FolderService.IsOfflineRootFolder(folder.FolderRootNode.NodePath))
            {
                return;
            }

            this.Items.Add(folder.FolderRootNode);

            DirectoryInfo parentNode = (new DirectoryInfo(folder.FolderRootNode.NodePath)).Parent;

            while (parentNode != null && !FolderService.IsOfflineRootFolder(parentNode.FullName))
            {
                this.Items.Insert(0, new OfflineFolderNodeViewModel(parentNode, folder));
                parentNode = (new DirectoryInfo(parentNode.FullName)).Parent;
            }
        }