C# Класс Crowbar.CrowbarViewContext

Represents the context of a view (partial or non-partial) that should be rendered for form submission.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
GetBoolFromAppSettings ( string name, bool defaultValue ) : bool

Описание методов

CrowbarViewContext() публичный Метод

Creates a new instance of CrowbarViewContext.
public CrowbarViewContext ( string viewName ) : System
viewName string The name of the view that should be rendered.
Результат System

FindViewEngineResult() публичный Метод

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.
Результат System.Web.Mvc.ViewEngineResult

GetRouteData() публичный Метод

Gets the route data that will be used by the request context.
public GetRouteData ( ) : System.Web.Routing.RouteData
Результат System.Web.Routing.RouteData

SetAnonymousPrincipal() публичный Метод

Sets the security principal to an anonymous user (no username), using a generic identity.
public SetAnonymousPrincipal ( ) : CrowbarViewContext
Результат CrowbarViewContext

SetFormsAuthPrincipal() публичный Метод

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.
Результат CrowbarViewContext