Method | Description | |
---|---|---|
Cancel ( ) : void |
Called if the request is cancelled
|
|
Dispose ( ) : void |
Dispose of resources here
|
|
FromFilePath ( string fileName, string mimeType = null ) : |
Gets the resource from the file path specified. Use the ResourceHandler.GetMimeType helper method to lookup the mimeType if required.
|
|
FromStream ( Stream stream, string mimeType = DefaultMimeType ) : |
Gets the resource from a stream.
|
|
FromString ( string text, |
Gets a ResourceHandler that represents a string. Without a Preamble, Cef will use BrowserSettings.DefaultEncoding to load the html.
|
|
FromString ( string text, string fileExtension ) : |
Gets the resource from the string.
|
|
GetMimeType ( string extension ) : string |
Gets the MIME type of the content.
|
|
GetResponse ( IResponse response, long &responseLength, string &redirectUrl ) : Stream |
Populate the response stream, response length. When this method is called the response should be fully populated with data. It is possible to redirect to another url at this point in time. NOTE: It's no longer manditory to implement this method, you can simply populate the properties of this instance and they will be set by the default implementation.
|
|
IResourceHandler ( ) : void | ||
IResourceHandler ( IResponse response, long &responseLength, string &redirectUrl ) : void | ||
ProcessRequestAsync ( IRequest request, ICallback callback ) : bool |
Begin processing the request. If you have the data in memory you can execute the callback immediately and return true. For Async processing you would typically spawn a Task to perform processing, then return true. When the processing is complete execute callback.Continue(); In your processing Task, simply set the StatusCode, StatusText, MimeType, ResponseLength and Stream
|
|
ResourceHandler ( ) : System |
Default Constructor
|
Method | Description | |
---|---|---|
FromFileName ( string filePath, string fileExtension = null ) : |
||
GetStream ( string text, |
||
IResourceHandler ( CefSharp.Cookie cookie ) : bool | ||
IResourceHandler ( IRequest request, ICallback callback ) : bool | ||
IResourceHandler ( Stream dataOut, int &bytesRead, ICallback callback ) : bool | ||
ResourceHandler ( string mimeType, ResourceHandlerType type ) : System |
Initializes a new instance of the ResourceHandler class.
|
public static FromFilePath ( string fileName, string mimeType = null ) : |
||
fileName | string | Location of the file. |
mimeType | string | The mimeType if null then text/html is used. |
return |
public static FromStream ( Stream stream, string mimeType = DefaultMimeType ) : |
||
stream | Stream | A stream of the resource. |
mimeType | string | Type of MIME. |
return |
public static FromString ( string text, |
||
text | string | The html string |
encoding | Character Encoding | |
includePreamble | bool | Include encoding preamble |
mimeType | string | Mime Type |
return |
public static FromString ( string text, string fileExtension ) : |
||
text | string | The text. |
fileExtension | string | The file extension. |
return |
public static GetMimeType ( string extension ) : string | ||
extension | string | The extension. |
return | string |
public GetResponse ( IResponse response, long &responseLength, string &redirectUrl ) : Stream | ||
response | IResponse | The response object used to set Headers, StatusCode, etc |
responseLength | long | length of the response |
redirectUrl | string | If set the request will be redirect to specified Url |
return | Stream |
public IResourceHandler ( IResponse response, long &responseLength, string &redirectUrl ) : void | ||
response | IResponse | |
responseLength | long | |
redirectUrl | string | |
return | void |
public ProcessRequestAsync ( IRequest request, ICallback callback ) : bool | ||
request | IRequest | The request object. |
callback | ICallback | The callback used to Continue or Cancel the request (async). |
return | bool |