Ejemplo n.º 1
0
        public List <FolderInfo> GetFolders()
        {
            List <FolderInfo> folders = new List <FolderInfo>();

            PathConverter pathConverter = PathConverter.GetInstance();

            if (!pathConverter.IsValidPath(this.virtualAddress))
            {
                this.virtualAddress = pathConverter.CorrectPath(this.virtualAddress);
            }

            List <string> folderPaths = pathConverter.GetFoldersPhysicalPathInVirtual(this.virtualAddress);

            foreach (var path in folderPaths)
            {
                if (settings.FolderFilter.Test(path))
                {
                    FolderInfo folderInfo = new FolderInfo(path, false);
                    folders.Add(folderInfo);
                }
            }

            folders = pathConverter.SortByNumeric <FolderInfo>(folders);

            return(folders);
        }
Ejemplo n.º 2
0
        public bool IsPlayable(out String parentVirtualDirectory)
        {
            PathConverter pathConverter = PathConverter.GetInstance();

            if (!pathConverter.IsValidPath(this.virtualAddress))
            {
                this.virtualAddress = pathConverter.CorrectPath(this.virtualAddress);
            }

            if (this.virtualAddress == null)
            {
                this.virtualAddress = String.Format("/{0}", settings.DefaultLibrary);
            }

            bool valid = settings.PlayFilter.Test(this.virtualAddress);

            if (valid)
            {
                parentVirtualDirectory = pathConverter.GetParentDirectory(this.virtualAddress);
            }
            else
            {
                parentVirtualDirectory = this.virtualAddress;
            }

            return(valid);
        }