예제 #1
0
        public IOrderedEnumerable <IContentSource> Evaluate(ResourceType resourceType)
        {
            var physicalPath = VirtualPathResolver.ResolveVirtualPathToDirectory(FolderVirtualPath);

            if (physicalPath == null)
            {
                return(Enumerable.Empty <IContentSource>().OrderBy(x => x));
            }

            return(Directory.GetFiles(physicalPath.FullName, SearchPattern ?? "*", IsRecursive ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly)
                   .Select(f => new FileInfo(f))
                   .Select(file => PhysicalFileRegister.For(file, resourceType, Mode))
                   .OfType <IContentSource>()
                   .OrderBy(x => new FileInfo(((PhysicalFileSource)x).PhysicalPath).Name));
        }
예제 #2
0
        private static PhysicalFileSource GetPhysicalFileFor(string requestedFilename)
        {
            requestedFilename = MakeVirtualPathFromRequestUrl(requestedFilename);

            return(PhysicalFileRegister.For(requestedFilename));
        }