示例#1
0
        private Task ShowCSSPage(IHttpContext context, string cssMatch)
        {
            if (cssMatch.IsEmptyOrNull())
            {
            }

            string text = HtmlBlockCreator.GetSaveTextFile(cssMatch);

            if (text.IsEmptyOrNull())
            {
                return(ShowErrorPage(context, 404, "Not found"));
            }
            context.Response.StatusCode = 200;
            return(context.SendStringAsync(text, "text/css", Encoding.UTF8));
        }
示例#2
0
        private Task ShowJSPage(IHttpContext context, string jsMatch)
        {
            if (jsMatch.IsEmptyOrNull())
            {
                return(ShowErrorPage(context, 404, "Not found"));
            }
            string text = HtmlBlockCreator.GetSaveTextFile(jsMatch);

            if (text.IsEmptyOrNull())
            {
                return(ShowErrorPage(context, 404, "Not found"));
            }
            context.Response.StatusCode = 200;
            return(context.SendStringAsync(text, "application/javascript", Encoding.UTF8));
        }
示例#3
0
 private Task ShowErrorPage(IHttpContext context, int error, string text)
 {
     context.Response.StatusCode = error;
     return(context.SendStringAsync(HtmlBlockCreator.CreateSimpleHtmlPage(text, "WebStyles"), "text/html", Encoding.UTF8));
 }