Esempio n. 1
0
        //DirectoryResource GenerateDirectory(string virtualPath)
        //{
        //    DirectoryResource dir;
        //    if (string.IsNullOrEmpty(virtualPath))
        //    {
        //        dir = RootDir;
        //    }
        //    else
        //        dir = new DirectoryEntry(Server.MapPath(virtualPath));
        //    return dir;
        //}

        //private string GenerateFilePath(string virtualPath, string fileName)
        //{
        //    return Path.Combine(GenerateDirectory(virtualPath).PhysicalPath, fileName);
        //}

        //private FileEntry GenerateFileEntry(string virtualPath, string fileName)
        //{

        //    return new FileEntry(GenerateFilePath(virtualPath, fileName));
        //}

        public virtual ActionResult Index(string directoryPath)
        {
            var fileGridModel = new ResourceGridModel()
            {
                Directory   = FileManager.GetDirectory(Site, directoryPath),
                Directories = FileManager.GetDirectories(Site, directoryPath).OfType <DirectoryEntry>(),
                Files       = FileManager.GetFiles(Site, directoryPath)
            };


            return(View(GetView("Index.aspx"), fileGridModel));
        }
Esempio n. 2
0
        public virtual ActionResult Index(string folderPath)
        {
            var fileGridModel = new ResourceGridModel()
            {
                Directory   = FileManager.GetDirectory(Site, folderPath),
                Directories = FileManager.GetDirectories(Site, folderPath).OfType <DirectoryEntry>(),
                Files       = FileManager.GetFiles(Site, folderPath)
            };

            ViewData["Title"] = FileManager.Type;

            return(View(fileGridModel));
        }