"景先生毕设|www.jxszl.com

C# BundleResponse类代码示例

2023-12-29 17:36编辑: www.jxszl.com景先生毕设
本文整理汇总了C#中BundleResponse类的典型用法代码示例。如果您正苦于以下问题:C#BundleResponse类的具体用法?C#BundleResponse怎么用?C#BundleResponse使用的例子?这里精选的类代码示例或许可以为您提供帮助。 示例1:Process /// ///ProcessesthespecifiedbundleofLESSfiles. /// /// ///TheLESSbundle. publicvoidProcess(BundleContextcontext,BundleResponsebundle) { if(bundle==null) thrownewArgumentNullException("bundle"); context.HttpContext.Response.Cache.SetLastModifiedFromFileDependencies(); varparser=newParser(); varengine=newLessEngine(parser); varcontent=newStringBuilder(); foreach(varfileinbundle.Files) { //setcurrentfilepath SetCurrentFilePath(parser,file.FullName); vartext=File.ReadAllText(file.FullName); varcss=engine.TransformToCss(text,file.FullName); content.AppendLine(css); //content.Append(engine.TransformToCss(text,file.FullName)); //content.AppendLine(); AddFileDependencies(parser); } bundle.Content=content.ToString(); bundle.ContentType="text/css"; }
原文链接:http://www.jxszl.com/biancheng/C/556612.html