C# 클래스 Rebel.Cms.Web.Mvc.ControllerFactories.PluginControllerFactory

Controller factory used for finding and instantiating plugin controllers
Since the DefaultControllerFactory in MVC performs some very aggressive caching of controllers in a cache file which persists app pool restarts. The subsystem queries the bin folder for changes made to the controllers but since plugin controllers aren't in the bin folder if they are loaded in the CodeGen folder they don't get updated, therefore this factory is required in order to ensure that plugin controllers don't get 'stale'
상속: System.Web.Mvc.DefaultControllerFactory, IFilteredControllerFactory
파일 보기 프로젝트 열기: RebelCMS/rebelcmsxu5

공개 메소드들

메소드 설명
CanHandle ( System.Web.Routing.RequestContext request ) : bool

This factory will attempt to return the controller only if the PluginManager is using the CodeGen folder andthe route values contains both the 'Namespaces' and 'rebel' data tokens in its route values.

PluginControllerFactory ( IRebelApplicationContext applicationContext ) : System

보호된 메소드들

메소드 설명
GetControllerType ( System.Web.Routing.RequestContext requestContext, string controllerName ) : Type

Returns the controller type for the specified controllerName based on the RouteData specified.

Since this factory should only fire for plugin controllers, we just check for the Namespace token and look it up in our cache, if it doesn't exist there, we'll check the BuildManager since we know we've registered it with that on pre app init. If nothing is found, then we'll just revert to using the base classes implementation.

메소드 상세

CanHandle() 공개 메소드

This factory will attempt to return the controller only if the PluginManager is using the CodeGen folder andthe route values contains both the 'Namespaces' and 'rebel' data tokens in its route values.
public CanHandle ( System.Web.Routing.RequestContext request ) : bool
request System.Web.Routing.RequestContext
리턴 bool

GetControllerType() 보호된 메소드

Returns the controller type for the specified controllerName based on the RouteData specified.
Since this factory should only fire for plugin controllers, we just check for the Namespace token and look it up in our cache, if it doesn't exist there, we'll check the BuildManager since we know we've registered it with that on pre app init. If nothing is found, then we'll just revert to using the base classes implementation.
protected GetControllerType ( System.Web.Routing.RequestContext requestContext, string controllerName ) : Type
requestContext System.Web.Routing.RequestContext
controllerName string
리턴 System.Type

PluginControllerFactory() 공개 메소드

public PluginControllerFactory ( IRebelApplicationContext applicationContext ) : System
applicationContext IRebelApplicationContext
리턴 System