public IndexViewModel Create(string orderBy, string direction, int skip, int take, string filter)
        {
            string bundlesPath = PathManager.GetBundlesPath(this.RequestHandler);

            return(new IndexViewModel()
            {
                Grid = new GridViewModelFactory(this.RequestHandler).Create(
                    orderBy, direction, skip, take, FileSystemRepository.CountFiles(bundlesPath, "*.json", filter),
                    new[] {
                    new GridColumnViewModelFactory(this.RequestHandler).Create("Filename", "Filename"),
                    new GridColumnViewModelFactory(this.RequestHandler).CreateEmpty()
                },
                    FileSystemRepository.GetFiles(bundlesPath, "*.json", filter, orderBy, direction, skip, take).Select(fi => new BundleViewModelFactory(this.RequestHandler).Create(fi)),
                    "_Bundle"
                    )
            });
        }
예제 #2
0
        public IndexViewModel Create(string orderBy, string direction, int skip, int take, string filter)
        {
            string stylesPath = PathManager.GetStylesPath(this.RequestHandler);
            IStringLocalizer <IndexViewModelFactory> localizer = this.RequestHandler.GetService <IStringLocalizer <IndexViewModelFactory> >();

            return(new IndexViewModel()
            {
                Grid = new GridViewModelFactory(this.RequestHandler).Create(
                    orderBy, direction, skip, take, FileSystemRepository.CountFiles(stylesPath, "*.css", filter),
                    new[] {
                    new GridColumnViewModelFactory(this.RequestHandler).Create(localizer["Filename"], "Filename"),
                    new GridColumnViewModelFactory(this.RequestHandler).CreateEmpty()
                },
                    FileSystemRepository.GetFiles(stylesPath, "*.css", filter, orderBy, direction, skip, take).Select(fi => new StyleViewModelFactory(this.RequestHandler).Create(fi)),
                    "_Style"
                    )
            });
        }
예제 #3
0
        public IndexViewModel Create(string orderBy, string direction, int skip, int take, string filter)
        {
            string scriptsPath = PathManager.GetScriptsPath(this.RequestHandler);
            IStringLocalizer <IndexViewModelFactory> localizer = this.RequestHandler.GetService <IStringLocalizer <IndexViewModelFactory> >();

            return(new IndexViewModel()
            {
                Grid = new GridViewModelFactory(this.RequestHandler).Create(
                    orderBy, direction, skip, take, FileSystemRepository.CountFiles(scriptsPath, "*.js", filter),
                    new[] {
                    new GridColumnViewModelFactory(this.RequestHandler).Create(localizer["Filename"], "Filename"),
                    new GridColumnViewModelFactory(this.RequestHandler).CreateEmpty()
                },
                    FileSystemRepository.GetFiles(scriptsPath, "*.js", filter, orderBy, direction, skip, take).Select(fi => new Platformus.Designers.Backend.ViewModels.Shared.ScriptViewModelFactory(this.RequestHandler).Create(fi)),
                    "_Script"
                    )
            });
        }
예제 #4
0
        public IndexViewModel Create(string orderBy, string direction, int skip, int take, string filter)
        {
            string extensionsPath = PathManager.GetExtensionsPath(this.RequestHandler);

            return(new IndexViewModel()
            {
                Grid = new GridViewModelFactory(this.RequestHandler).Create(
                    orderBy, direction, skip, take, FileSystemRepository.CountFiles(extensionsPath, "*.extension", filter),
                    new[] {
                    new GridColumnViewModelFactory(this.RequestHandler).Create("ID", "filename"),
                    new GridColumnViewModelFactory(this.RequestHandler).Create("Name", string.Empty),
                    new GridColumnViewModelFactory(this.RequestHandler).Create("Version", string.Empty),
                    new GridColumnViewModelFactory(this.RequestHandler).CreateEmpty()
                },
                    FileSystemRepository.GetFiles(extensionsPath, "*.extension", filter, orderBy, direction, skip, take).Select(fi => new ExtensionViewModelFactory(this.RequestHandler).Create(fi)),
                    "_Extension"
                    )
            });
        }
예제 #5
0
        public IndexViewModel Create(string subdirectory, string orderBy, string direction, int skip, int take, string filter)
        {
            string rootViewsPath = PathManager.GetViewsPath(this.RequestHandler, null);
            string viewsPath     = PathManager.GetViewsPath(this.RequestHandler, subdirectory);

            return(new IndexViewModel()
            {
                Subdirectory = string.IsNullOrEmpty(subdirectory) ? null : new DirectoryViewModelFactory(this.RequestHandler).Create(FileSystemRepository.GetDirectories(rootViewsPath).FirstOrDefault(di => di.Name.ToLower() == subdirectory)),
                Subdirectories = FileSystemRepository.GetDirectories(rootViewsPath).Select(di => new DirectoryViewModelFactory(this.RequestHandler).Create(di)),
                Grid = new GridViewModelFactory(this.RequestHandler).Create(
                    orderBy, direction, skip, take, FileSystemRepository.CountFiles(viewsPath, "*.cshtml", filter),
                    new[] {
                    new GridColumnViewModelFactory(this.RequestHandler).Create("Filename", "Filename"),
                    new GridColumnViewModelFactory(this.RequestHandler).CreateEmpty()
                },
                    FileSystemRepository.GetFiles(viewsPath, "*.cshtml", filter, orderBy, direction, skip, take).Select(fi => new ViewViewModelFactory(this.RequestHandler).Create(subdirectory, fi)),
                    "_View"
                    )
            });
        }