public CombiningCssLinkTagWriter(IContentFolderService folderService, IContentFileCombiner fileCombiner, CssLinkTagWriter singleFileWriter)
 {
     _folderService = folderService;
     _fileCombiner = fileCombiner;
     _singleFileWriter = singleFileWriter;
     _folderService.RegisterDirectory(FileSystem.Combine(FubuMvcPackageFacility.GetApplicationPath(), "content"));
 }
Ejemplo n.º 2
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 "~/_{0}/{1}".ToFormat(_contentType, filename.TrimStart('/'));
                }

                return "~/content/{0}/{1}".ToFormat(_contentType, filename.TrimStart('/'));
            };
        }
Ejemplo 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('/')));
            };
        }
Ejemplo n.º 4
0
 public CombiningCssLinkTagWriter(IContentFolderService folderService, IContentFileCombiner fileCombiner, CssLinkTagWriter singleFileWriter)
 {
     _folderService    = folderService;
     _fileCombiner     = fileCombiner;
     _singleFileWriter = singleFileWriter;
     _folderService.RegisterDirectory(FileSystem.Combine(FubuMvcPackageFacility.GetApplicationPath(), "content"));
 }
Ejemplo 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('/'));
            };
        }
Ejemplo n.º 6
0
 public ScriptRequirements(IContentFolderService folders)
 {
     _folders = folders;
 }
Ejemplo 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);
 }
Ejemplo n.º 8
0
 public ScriptRequirements(IContentFolderService folders, ScriptGraph scriptGraph)
 {
     _folders = folders;
     _scriptGraph = scriptGraph;
 }
Ejemplo n.º 9
0
 public void SetUp()
 {
     folders         = MockRepository.GenerateMock <IContentFolderService>();
     theContentFiles = new ContentFiles(folders, ContentType.images);
 }
Ejemplo n.º 10
0
 public FileRouteHandler(IContentFolderService folders, ContentType contentType)
 {
     _folders = folders;
     _contentType = contentType;
 }
Ejemplo n.º 11
0
 public FileRouteHandler(IContentFolderService folders, ContentType contentType, IMimeTypeProvider mimeTypeProvider)
 {
     _folders          = folders;
     _contentType      = contentType;
     _mimeTypeProvider = mimeTypeProvider;
 }
Ejemplo n.º 12
0
 public ScriptRequirements(IContentFolderService folders)
 {
     _folders = folders;
 }
Ejemplo n.º 13
0
 public FileRouteHandler(IContentFolderService folders, ContentType contentType, IMimeTypeProvider mimeTypeProvider)
 {
     _folders = folders;
     _contentType = contentType;
     _mimeTypeProvider = mimeTypeProvider;
 }
Ejemplo n.º 14
0
 public PackageFolderActivator(IContentFolderService contents)
 {
     _contents = contents;
 }
Ejemplo 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);
 }
Ejemplo n.º 16
0
 public PackageFolderActivator(IContentFolderService contents)
 {
     _contents = contents;
 }
Ejemplo n.º 17
0
 public void SetUp()
 {
     folders = MockRepository.GenerateMock<IContentFolderService>();
     theContentFiles = new ContentFiles(folders, ContentType.images);
 }
Ejemplo n.º 18
0
 public ScriptRequirements(IContentFolderService folders, ScriptGraph scriptGraph)
 {
     _folders     = folders;
     _scriptGraph = scriptGraph;
 }