C# Class GSF.Web.Hosting.WebServer

Represents the web server engine for WebPageController instances.
Show file Open project: GridProtectionAlliance/gsf Class Usage Examples

Public Methods

Method Description
Dispose ( ) : void

Releases all the resources used by the WebServer object.

RenderResponse ( HttpRequestMessage request, string pageName, bool isPost, CancellationToken cancellationToken, object model = null, Type modelType = null, AdoDataConnection database = null ) : Task

Renders an HTTP response for a given request.

WebServer ( string webRootPath = null, IRazorEngine razorEngineCS = null, IRazorEngine razorEngineVB = null ) : System

Creates a new WebServer.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Releases the unmanaged resources used by the WebServer object and optionally releases the managed resources.

Private Methods

Method Description
GetConfiguredServer ( string settingsCategory = null, IRazorEngine razorEngineCS = null, IRazorEngine razorEngineVB = null ) : WebServer
GetResourceFileName ( string pageName, bool embeddedResource ) : string
OnExecutionException ( Exception exception ) : void
OnStatusMessage ( string message ) : void
OpenResourceAsync ( string fileName, bool embeddedResource, CancellationToken cancellationToken ) : Task
ProcessHTTPHandlerAsync ( string pageName, bool embeddedResource, HttpRequestMessage request, HttpResponseMessage response, CancellationToken cancellationToken ) : Task
PublishResponseContent ( HttpRequestMessage request, HttpResponseMessage response, long responseHash ) : bool
ResourceExists ( string fileName, bool embeddedResource ) : bool
WebServer ( ) : System
m_fileWatcher_FileChange ( object sender, FileSystemEventArgs e ) : void

Method Details

Dispose() public method

Releases all the resources used by the WebServer object.
public Dispose ( ) : void
return void

Dispose() protected method

Releases the unmanaged resources used by the WebServer object and optionally releases the managed resources.
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; false to release only unmanaged resources.
return void

RenderResponse() public method

Renders an HTTP response for a given request.
public RenderResponse ( HttpRequestMessage request, string pageName, bool isPost, CancellationToken cancellationToken, object model = null, Type modelType = null, AdoDataConnection database = null ) : Task
request System.Net.Http.HttpRequestMessage HTTP request message.
pageName string Name of page to render.
isPost bool trueif is HTTP post; otherwise, false.
cancellationToken System.Threading.CancellationToken Propagates notification from client that operations should be canceled.
model object Reference to model to use when rendering Razor templates, if any.
modelType System.Type Type of , if any.
database AdoDataConnection to use, if any.
return Task

WebServer() public method

Creates a new WebServer.
public WebServer ( string webRootPath = null, IRazorEngine razorEngineCS = null, IRazorEngine razorEngineVB = null ) : System
webRootPath string Root path for web server; defaults to template path for .
razorEngineCS IRazorEngine Razor engine instance for .cshtml templates; uses default instance if not provided.
razorEngineVB IRazorEngine Razor engine instance for .vbhtml templates; uses default instance if not provided.
return System