C# Class Crowbar.CrowbarViewContext

Represents the context of a view (partial or non-partial) that should be rendered for form submission.
Show file Open project: mrydengren/crowbar Class Usage Examples

Public Methods

Method Description
CrowbarViewContext ( string viewName ) : System

Creates a new instance of CrowbarViewContext.

FindViewEngineResult ( System.Web.Mvc.ControllerContext controllerContext ) : System.Web.Mvc.ViewEngineResult

Finds a view based on the specified view name.

GetRouteData ( ) : System.Web.Routing.RouteData

Gets the route data that will be used by the request context.

SetAnonymousPrincipal ( ) : CrowbarViewContext

Sets the security principal to an anonymous user (no username), using a generic identity.

SetFormsAuthPrincipal ( string username, int timeout = 30 ) : CrowbarViewContext

Sets the security principal, using forms identity, in which the view should be rendered.

Private Methods

Method Description
GetBoolFromAppSettings ( string name, bool defaultValue ) : bool

Method Details

CrowbarViewContext() public method

Creates a new instance of CrowbarViewContext.
public CrowbarViewContext ( string viewName ) : System
viewName string The name of the view that should be rendered.
return System

FindViewEngineResult() public method

Finds a view based on the specified view name.
public FindViewEngineResult ( System.Web.Mvc.ControllerContext controllerContext ) : System.Web.Mvc.ViewEngineResult
controllerContext System.Web.Mvc.ControllerContext The controller context.
return System.Web.Mvc.ViewEngineResult

GetRouteData() public method

Gets the route data that will be used by the request context.
public GetRouteData ( ) : System.Web.Routing.RouteData
return System.Web.Routing.RouteData

SetAnonymousPrincipal() public method

Sets the security principal to an anonymous user (no username), using a generic identity.
public SetAnonymousPrincipal ( ) : CrowbarViewContext
return CrowbarViewContext

SetFormsAuthPrincipal() public method

Sets the security principal, using forms identity, in which the view should be rendered.
public SetFormsAuthPrincipal ( string username, int timeout = 30 ) : CrowbarViewContext
username string The username.
timeout int The time, in minutes, for which the forms authentication cookie is valid.
return CrowbarViewContext