/// <summary> /// Registers HTML Template Bundles with Bundle Collection /// </summary> /// <exception cref="System.Exception">Unable to locate htmlTemplateBundle.config file</exception> public static void Register() { if (File.Exists(HttpContext.Current.Server.MapPath(@"/htmlTemplateBundle.config"))) { using (FileStream fileStream = File.OpenRead(HttpContext.Current.Server.MapPath(@"/htmlTemplateBundle.config"))) { HtmlTemplateBundleManifest.ReadBundleManifest((Stream)fileStream).Register(BundleTable.Bundles); } } }
/// <summary> /// Reads the bundle manifest. /// </summary> /// <param name="vpp">The VPP.</param> /// <returns></returns> internal static HtmlTemplateBundleManifest ReadBundleManifest(VirtualPathProvider vpp) { if (vpp == null) { return((HtmlTemplateBundleManifest)null); } if (!vpp.FileExists(HtmlTemplateBundleManifest.BundleManifestPath)) { return((HtmlTemplateBundleManifest)null); } using (Stream bundleStream = vpp.GetFile(HtmlTemplateBundleManifest.BundleManifestPath).Open()) return(HtmlTemplateBundleManifest.ReadBundleManifest(bundleStream)); }
/// <summary> /// Reads the bundle manifest using the default bundle configuration. /// </summary> /// /// <returns> /// The bundle manifest. /// </returns> public static HtmlTemplateBundleManifest ReadBundleManifest() { return(HtmlTemplateBundleManifest.ReadBundleManifest(BundleTable.VirtualPathProvider)); }