public ActionResult Index() { IOptimizedResult sample = ResourceHandler.Create <IOptimizedResult>(HomeController.SamplePath); IOptimizedResult support = ResourceHandler.Create <IOptimizedResult>(JbstController.SupportScriptPath); // populate data to be used in view return(this.View(new HomeViewModel(sample.Source, support))); }
private IOptimizedResult ProcessPrecompiled(IResourceBuildHelper helper, string file) { IOptimizedResult result = ResourceHandler.Create <IOptimizedResult>(file); if (result != null) { if (!this.isMimeSet && !String.IsNullOrEmpty(result.ContentType) && !String.IsNullOrEmpty(result.FileExtension)) { this.contentType = result.ContentType; this.fileExtension = result.FileExtension; this.isMimeSet = true; } if (result is IGlobalizedBuildResult) { this.GlobalizationKeys.AddRange(((IGlobalizedBuildResult)result).GlobalizationKeys); } helper.AddVirtualPathDependency(file); ICollection dependencies = BuildManager.GetVirtualPathDependencies(file); if (dependencies != null) { foreach (string dependency in dependencies) { helper.AddVirtualPathDependency(dependency); } } if (result is IDependentResult) { foreach (string dependency in ((IDependentResult)result).VirtualPathDependencies) { helper.AddVirtualPathDependency(dependency); } } } return(result); }
/// <summary> /// Ctor /// </summary> /// <param name="path"></param> public ResourceResult(string resourcePath) { this.ResourcePath = resourcePath; this.Resource = ResourceHandler.Create <IOptimizedResult>(resourcePath); this.IsDebug = HttpContext.Current.IsDebuggingEnabled; }