C# Class Castle.MonoRail.Framework.Services.DefaultUrlTokenizer

Breaks the url into smaller pieces to find out the requested controller, action and optionally the area.

It alsos checks for default urls which map a single resource to an area/controller/action

Inheritance: IUrlTokenizer, IServiceEnabledComponent
ファイルを表示 Open project: nats/castle-1.0.3-mono Class Usage Examples

Public Methods

Method Description
AddDefaultRule ( string url, string area, string controller, string action ) : void

Adds the default rule mapping.

A defautl rule can associate something like a 'default.castle' to a controller/action like 'Home/index.castle'

Service ( IServiceProvider provider ) : void

Services the specified provider.

TokenizeUrl ( string rawUrl, Uri uri, bool isLocal, string appVirtualDir ) : System.UrlInfo

Tokenizes the URL.

Protected Methods

Method Description
GetDomainToken ( string domain, int token ) : string

Gets the domain token.

GetExtension ( string url ) : string

Gets the extension of the requested urls page without the preceding period.

Private Methods

Method Description
ExtractAreaControllerAction ( string rawUrl, string &area, string &controller, string &action ) : void

Extracts the area controller action.

Method Details

AddDefaultRule() public method

Adds the default rule mapping.
A defautl rule can associate something like a 'default.castle' to a controller/action like 'Home/index.castle'
public AddDefaultRule ( string url, string area, string controller, string action ) : void
url string The URL.
area string The area.
controller string The controller.
action string The action.
return void

GetDomainToken() protected static method

Gets the domain token.
protected static GetDomainToken ( string domain, int token ) : string
domain string The domain.
token int The token index.
return string

GetExtension() protected static method

Gets the extension of the requested urls page without the preceding period.
protected static GetExtension ( string url ) : string
url string URL.
return string

Service() public method

Services the specified provider.
public Service ( IServiceProvider provider ) : void
provider IServiceProvider The provider.
return void

TokenizeUrl() public method

Tokenizes the URL.
public TokenizeUrl ( string rawUrl, Uri uri, bool isLocal, string appVirtualDir ) : System.UrlInfo
rawUrl string The raw URL.
uri System.Uri The URI.
isLocal bool if set to true [is local].
appVirtualDir string Virtual directory
return System.UrlInfo