C# Class CompiledViews.Mvc.CompiledRazorViewEngine

Allow to embed precompiled razorviews (or any other webviewpage) Things that would be nice to have in Microsoft's code: - public access to VirtualPathFactoryManager.Instance - public access to VirtualPathFactoryManager.PageExists - let either store IVirtualPathFactory just the Type to construct instead of a constructor, or: let DictionaryBasedVirtualPathFactory use IoC if it's registered - allow to override BuildManager implementations, that way we could hook into the framework on that level, instead of creating an extra viewengine
Inheritance: System.Web.Mvc.VirtualPathProviderViewEngine
Mostrar archivo Open project: tqc/RazorEngine Class Usage Examples

Private Properties

Property Type Description
CompiledRazorViewEngine System

Public Methods

Method Description
GetPageType ( string virtualPath ) : Type

Get the type of the viewpage class for a virtual path. Returns null if the view page does not exist

RegisterViewAssembly ( Assembly a ) : void

Find all views in the assembly and map them to virtual paths. Views with the same virtual path will overwrite existing views to allow an individual project to override views from a common library.

Protected Methods

Method Description
CreatePartialView ( System.Web.Mvc.ControllerContext controllerContext, string partialPath ) : IView
CreateView ( System.Web.Mvc.ControllerContext controllerContext, string viewPath, string masterPath ) : IView
FileExists ( System.Web.Mvc.ControllerContext controllerContext, string virtualPath ) : bool

Private Methods

Method Description
CompiledRazorViewEngine ( ) : System

Method Details

CreatePartialView() protected method

protected CreatePartialView ( System.Web.Mvc.ControllerContext controllerContext, string partialPath ) : IView
controllerContext System.Web.Mvc.ControllerContext
partialPath string
return IView

CreateView() protected method

protected CreateView ( System.Web.Mvc.ControllerContext controllerContext, string viewPath, string masterPath ) : IView
controllerContext System.Web.Mvc.ControllerContext
viewPath string
masterPath string
return IView

FileExists() protected method

protected FileExists ( System.Web.Mvc.ControllerContext controllerContext, string virtualPath ) : bool
controllerContext System.Web.Mvc.ControllerContext
virtualPath string
return bool

GetPageType() public static method

Get the type of the viewpage class for a virtual path. Returns null if the view page does not exist
public static GetPageType ( string virtualPath ) : Type
virtualPath string
return System.Type

RegisterViewAssembly() public static method

Find all views in the assembly and map them to virtual paths. Views with the same virtual path will overwrite existing views to allow an individual project to override views from a common library.
public static RegisterViewAssembly ( Assembly a ) : void
a System.Reflection.Assembly
return void