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('/'));
            };
        }
Esempio n. 3
0
        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('/')));
            };
        }
Esempio n. 4
0
 public CombiningCssLinkTagWriter(IContentFolderService folderService, IContentFileCombiner fileCombiner, CssLinkTagWriter singleFileWriter)
 {
     _folderService    = folderService;
     _fileCombiner     = fileCombiner;
     _singleFileWriter = singleFileWriter;
     _folderService.RegisterDirectory(FileSystem.Combine(FubuMvcPackageFacility.GetApplicationPath(), "content"));
 }
Esempio n. 5
0
        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;
 }
Esempio n. 7
0
 public ContentRegistryCache(IContentFolderService folders)
 {
     _images  = new ContentFiles(folders, ContentType.images);
     _scripts = new ContentFiles(folders, ContentType.scripts);
     _styles  = new ContentFiles(folders, ContentType.styles);
 }
Esempio n. 8
0
 public ScriptRequirements(IContentFolderService folders, ScriptGraph scriptGraph)
 {
     _folders = folders;
     _scriptGraph = scriptGraph;
 }
Esempio n. 9
0
 public void SetUp()
 {
     folders         = MockRepository.GenerateMock <IContentFolderService>();
     theContentFiles = new ContentFiles(folders, ContentType.images);
 }
Esempio n. 10
0
 public FileRouteHandler(IContentFolderService folders, ContentType contentType)
 {
     _folders = folders;
     _contentType = contentType;
 }
Esempio n. 11
0
 public FileRouteHandler(IContentFolderService folders, ContentType contentType, IMimeTypeProvider mimeTypeProvider)
 {
     _folders          = folders;
     _contentType      = contentType;
     _mimeTypeProvider = mimeTypeProvider;
 }
Esempio n. 12
0
 public ScriptRequirements(IContentFolderService folders)
 {
     _folders = folders;
 }
Esempio n. 13
0
 public FileRouteHandler(IContentFolderService folders, ContentType contentType, IMimeTypeProvider mimeTypeProvider)
 {
     _folders = folders;
     _contentType = contentType;
     _mimeTypeProvider = mimeTypeProvider;
 }
Esempio n. 14
0
 public PackageFolderActivator(IContentFolderService contents)
 {
     _contents = contents;
 }
Esempio n. 15
0
 public ContentRegistryCache(IContentFolderService folders)
 {
     _images = new ContentFiles(folders, ContentType.images);
     _scripts = new ContentFiles(folders, ContentType.scripts);
     _styles = new ContentFiles(folders, ContentType.styles);
 }
 public PackageFolderActivator(IContentFolderService contents)
 {
     _contents = contents;
 }
Esempio n. 17
0
 public void SetUp()
 {
     folders = MockRepository.GenerateMock<IContentFolderService>();
     theContentFiles = new ContentFiles(folders, ContentType.images);
 }
Esempio n. 18
0
 public ScriptRequirements(IContentFolderService folders, ScriptGraph scriptGraph)
 {
     _folders     = folders;
     _scriptGraph = scriptGraph;
 }