From ca5f49b08ca59f5804c128aeb28ca8ff1e310bdd Mon Sep 17 00:00:00 2001 From: Phillip Haydon Date: Mon, 13 Aug 2012 14:03:57 +0800 Subject: [PATCH] fixed formatting --- NuGet/content/Mvc.Bundler.cs | 43 ++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/NuGet/content/Mvc.Bundler.cs b/NuGet/content/Mvc.Bundler.cs index 70b75549..51178de6 100644 --- a/NuGet/content/Mvc.Bundler.cs +++ b/NuGet/content/Mvc.Bundler.cs @@ -253,38 +253,37 @@ public static MvcHtmlString RenderJsBundle(this HtmlHelper html, string bundlePa } public static MvcHtmlString RenderCssBundle(this HtmlHelper html, string bundlePath, BundleOptions options = BundleOptions.Minified, string media = null) - { - if (string.IsNullOrEmpty(bundlePath)) - return MvcHtmlString.Empty; + { + if (string.IsNullOrEmpty(bundlePath)) + return MvcHtmlString.Empty; - if (!CachePaths()) BundleCache.SafeClear(); + if (!CachePaths()) BundleCache.SafeClear(); - return BundleCache.GetOrAdd(bundlePath, str => - { - var filePath = HostingEnvironment.MapPath(bundlePath); + return BundleCache.GetOrAdd(bundlePath, str => { + var filePath = HostingEnvironment.MapPath(bundlePath); - var baseUrl = VirtualPathUtility.GetDirectory(bundlePath); + var baseUrl = VirtualPathUtility.GetDirectory(bundlePath); - if (options == BundleOptions.Combined) + if (options == BundleOptions.Combined) return html.Css(bundlePath.Replace(".bundle", ""), media, options); - if (options == BundleOptions.MinifiedAndCombined) + if (options == BundleOptions.MinifiedAndCombined) return html.Css(bundlePath.Replace(".css.bundle", ".min.css"), media, options); - var cssFiles = File.ReadAllLines(filePath); + var cssFiles = File.ReadAllLines(filePath); - var styles = new StringBuilder(); - foreach (var file in cssFiles) - { - var cssFile = file.Trim().Replace(".less", ".css"); - var cssSrc = Path.Combine(baseUrl, cssFile); + var styles = new StringBuilder(); + foreach (var file in cssFiles) + { + var cssFile = file.Trim().Replace(".less", ".css"); + var cssSrc = Path.Combine(baseUrl, cssFile); - styles.AppendLine( + styles.AppendLine( html.Css(cssSrc, media, options).ToString() - ); - } + ); + } - return styles.ToString().ToMvcHtmlString(); - }); - } + return styles.ToString().ToMvcHtmlString(); + }); + } } } \ No newline at end of file