C# Class Rebel.Cms.Web.Mvc.ViewEngines.AlternateLocationViewEngine

A ViewEngine that allows a controller's views to be shared with other controllers without having to put these shared views in the 'Shared' folder. This is useful for when you have inherited controllers. This will allow of 'overriding' of views, for example if i have a controller called 'Media' that has an alternate view location of 'Content', the 'Content' folder could contain all of the partial views necessary, but we could have a different main view in the 'Media' folder which would be used and then all of the 'Content' partial views could be used.
Inheritance: System.Web.Mvc.RazorViewEngine
ファイルを表示 Open project: RebelCMS/rebelcmsxu5

Public Methods

Method Description
AlternateLocationViewEngine ( ) : System
FindPartialView ( ControllerContext controllerContext, string partialViewName, bool useCache ) : System.Web.Mvc.ViewEngineResult
FindView ( ControllerContext controllerContext, string viewName, string masterName, bool useCache ) : System.Web.Mvc.ViewEngineResult

Private Methods

Method Description
GetAlternateControllerContext ( ControllerContext currentContext ) : ControllerContext

Returns a new controller context with the alternate controller name in the route values if the current controller is found to contain an AlternateViewEnginePathAttribute.

Method Details

AlternateLocationViewEngine() public method

public AlternateLocationViewEngine ( ) : System
return System

FindPartialView() public method

public FindPartialView ( ControllerContext controllerContext, string partialViewName, bool useCache ) : System.Web.Mvc.ViewEngineResult
controllerContext ControllerContext
partialViewName string
useCache bool
return System.Web.Mvc.ViewEngineResult

FindView() public method

public FindView ( ControllerContext controllerContext, string viewName, string masterName, bool useCache ) : System.Web.Mvc.ViewEngineResult
controllerContext ControllerContext
viewName string
masterName string
useCache bool
return System.Web.Mvc.ViewEngineResult