コード例 #1
0
        public FontsHandler(string fontName)
            : base(typeof(FontsHandler).Assembly, HangFirePageFactory.GetContentResourceName("fonts", fontName))
        {
            CacheResponse = true;

            if (fontName.EndsWith(".eot", StringComparison.OrdinalIgnoreCase))
            {
                ContentType = "application/vnd.ms-fontobject";
            }
            else if (fontName.EndsWith(".svg", StringComparison.OrdinalIgnoreCase))
            {
                ContentType = "image/svg+xml";
            }
            else if (fontName.EndsWith(".ttf", StringComparison.OrdinalIgnoreCase))
            {
                ContentType = "application/octet-stream";
            }
            else if (fontName.EndsWith(".woff", StringComparison.OrdinalIgnoreCase))
            {
                ContentType = "application/font-woff";
            }
        }
コード例 #2
0
 public StyleSheetHandler()
     : base(typeof(StyleSheetHandler).Assembly, HangFirePageFactory.GetContentFolderNamespace("css"), Stylesheets)
 {
     ContentType     = "text/css";
     ContentEncoding = Encoding.UTF8;
 }
コード例 #3
0
 public JavaScriptHandler()
     : base(typeof(JavaScriptHandler).Assembly, HangFirePageFactory.GetContentFolderNamespace("js"), Javascripts)
 {
     ContentType     = "application/javascript";
     ContentEncoding = Encoding.UTF8;
 }