C# Class BVNetwork.NotFound.Core.Custom404Handler

显示文件 Open project: BVNetwork/404handler

Public Methods

Method Description
FileNotFoundExceptionHandler ( object sender, EventArgs e ) : void
FileNotFoundHandler ( object sender, EventArgs evt ) : void
GetReferer ( Uri referer ) : string
HandleRequest ( string referer, Uri urlNotFound, BVNetwork.NotFound.Core.CustomRedirects.CustomRedirect &foundRedirect ) : bool

Protected Methods

Method Description
SetStatusCodeAndShow404 ( HttpContext context, int statusCode = 404 ) : void

Private Methods

Method Description
CheckForException ( HttpContext context, Uri notFoundUri ) : bool
GetContext ( ) : HttpContext
IsLocalhost ( ) : bool

Determines whether the current request is on localhost.

IsResourceFile ( Uri notFoundUri ) : bool

Determines whether the specified not found URI is a resource file

Method Details

FileNotFoundExceptionHandler() public static method

public static FileNotFoundExceptionHandler ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void

FileNotFoundHandler() public static method

public static FileNotFoundHandler ( object sender, EventArgs evt ) : void
sender object
evt System.EventArgs
return void

GetReferer() public static method

public static GetReferer ( Uri referer ) : string
referer System.Uri
return string

HandleRequest() public static method

public static HandleRequest ( string referer, Uri urlNotFound, BVNetwork.NotFound.Core.CustomRedirects.CustomRedirect &foundRedirect ) : bool
referer string
urlNotFound System.Uri
foundRedirect BVNetwork.NotFound.Core.CustomRedirects.CustomRedirect
return bool

SetStatusCodeAndShow404() protected static method

protected static SetStatusCodeAndShow404 ( HttpContext context, int statusCode = 404 ) : void
context System.Web.HttpContext
statusCode int
return void