public CombiningCssLinkTagWriter(IContentFolderService folderService, IContentFileCombiner fileCombiner, CssLinkTagWriter singleFileWriter) { _folderService = folderService; _fileCombiner = fileCombiner; _singleFileWriter = singleFileWriter; _folderService.RegisterDirectory(FileSystem.Combine(FubuMvcPackageFacility.GetApplicationPath(), "content")); }
public ContentFiles(IContentFolderService service, ContentType contentType) { _service = service; _contentType = contentType; /* * You might be wondering, "why is it doing this?" * The goal of the below is to say: * 1.) Use the url to the main application's content/{type} if the file exists there * 2.) If not, try to find it in a package folder. If found, pull it from the package folder * 3.) Finally, try the url to the main application and just hope. * * This implementation isn't smart enough to deal with "appended" virtual directory paths * */ _urls.OnMissing = filename => { if (_service.ExistsInApplicationDirectory(_contentType, filename)) { return "~/content/{0}/{1}".ToFormat(_contentType, filename.TrimStart('/')); } if (_service.FileExists(_contentType, filename)) { return "~/_{0}/{1}".ToFormat(_contentType, filename.TrimStart('/')); } return "~/content/{0}/{1}".ToFormat(_contentType, filename.TrimStart('/')); }; }
public ContentFiles(IContentFolderService service, ContentType contentType) { _service = service; _contentType = contentType; /* * You might be wondering, "why is it doing this?" * The goal of the below is to say: * 1.) Use the url to the main application's content/{type} if the file exists there * 2.) If not, try to find it in a package folder. If found, pull it from the package folder * 3.) Finally, try the url to the main application and just hope. * * This implementation isn't smart enough to deal with "appended" virtual directory paths * */ _urls.OnMissing = filename => { if (_service.ExistsInApplicationDirectory(_contentType, filename)) { return("~/content/{0}/{1}".ToFormat(_contentType, filename.TrimStart('/'))); } if (_service.FileExists(_contentType, filename)) { return("~/_content/{0}/{1}".ToFormat(_contentType, filename.TrimStart('/'))); } return("~/content/{0}/{1}".ToFormat(_contentType, filename.TrimStart('/'))); }; }
public ContentFiles(IContentFolderService service, ContentType contentType) { _service = service; _contentType = contentType; _urls.OnMissing = filename => { if (_service.ExistsInApplicationDirectory(_contentType, filename)) { return "~/content/{0}/{1}".ToFormat(_contentType, filename.TrimStart('/')); } return "~/_{0}/{1}".ToFormat(_contentType, filename.TrimStart('/')); }; }
public ScriptRequirements(IContentFolderService folders) { _folders = folders; }
public ContentRegistryCache(IContentFolderService folders) { _images = new ContentFiles(folders, ContentType.images); _scripts = new ContentFiles(folders, ContentType.scripts); _styles = new ContentFiles(folders, ContentType.styles); }
public ScriptRequirements(IContentFolderService folders, ScriptGraph scriptGraph) { _folders = folders; _scriptGraph = scriptGraph; }
public void SetUp() { folders = MockRepository.GenerateMock <IContentFolderService>(); theContentFiles = new ContentFiles(folders, ContentType.images); }
public FileRouteHandler(IContentFolderService folders, ContentType contentType) { _folders = folders; _contentType = contentType; }
public FileRouteHandler(IContentFolderService folders, ContentType contentType, IMimeTypeProvider mimeTypeProvider) { _folders = folders; _contentType = contentType; _mimeTypeProvider = mimeTypeProvider; }
public PackageFolderActivator(IContentFolderService contents) { _contents = contents; }
public void SetUp() { folders = MockRepository.GenerateMock<IContentFolderService>(); theContentFiles = new ContentFiles(folders, ContentType.images); }