Default implementation of
IResourceHandler. This latest implementation provides some simplification, at a minimum you only need to override ProcessRequestAsync. See the project source on GitHub for working examples. used to implement a custom request handler interface. The methods of this class will always be called on the IO thread. Static helper methods are included like FromStream and FromString that make dealing with fixed resources easy.
Inheritance Hierarchy Namespace: CefSharpCefSharp (in CefSharp.dll) Version: 118.6.80.0 (118.6.80.0)
Syntaxpublic class ResourceHandler : IResourceHandler, IDisposable
public ref class ResourceHandler : IResourceHandler, IDisposable
The ResourceHandler type exposes the following members.
Constructors Name Description ResourceHandlerInitializes a new instance of the ResourceHandler class.
Top Properties Name Description AutoDisposeStreamWhen true the Stream will be Disposed when this instance is Disposed. The default value for this property is false.
CharsetGets or sets the Charset
ErrorCodeIf the ErrorCode is set then the response will be ignored and the errorCode returned.
HeadersGets or sets the headers.
MimeTypeGets or sets the Mime Type.
ResponseLengthGets or sets ResponseLength, when you know the size of your Stream (Response) set this property. This is optional. If you use a MemoryStream and don't provide a value here then it will be cast and its size used
StatusCodeGets or sets the http status code.
StatusTextGets or sets the status text.
StreamGets or sets the resource stream.
Top Methods Name Description DisposeDispose of resources here
EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object.) FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.) ForErrorMessageGenerates a ResourceHandler that has it's StatusCode set
FromByteArrayCreates a IResourceHandler that represents a Byte[], uses CefStreamResourceHandler for reading the data
FromFilePathGets the resource from the file path specified. Use the Cef.GetMimeType() helper method to lookup the mimeType if required. Uses CefStreamResourceHandler for reading the data
FromStreamGets the resource from a stream.
FromString(String, String) Obsolete.Gets the resource from the string.
FromString(String, Encoding, Boolean, String)Gets a ResourceHandler that represents a string. Without a Preamble, Cef will use BrowserSettings.DefaultEncoding to load the html.
GetByteArrayGets a byteArray from the given string using the provided encoding
GetHashCodeServes as the default hash function.
(Inherited from Object.) GetMemoryStreamGets a MemoryStream from the given string using the provided encoding
GetMimeTypeGets the MIME type of the content.
GetTypeGets the
Typeof the current instance.
(Inherited from Object.) MemberwiseCloneCreates a shallow copy of the current
Object.
(Inherited from Object.) ProcessRequestAsyncBegin 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
ToStringReturns a string that represents the current object.
(Inherited from Object.) Top Fields See AlsoRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4