An open API service indexing awesome lists of open source software.

https://github.com/mganss/asyncpluggableprotocol

C# Asynchronous Pluggable Protocol Handler
https://github.com/mganss/asyncpluggableprotocol

Last synced: 5 months ago
JSON representation

C# Asynchronous Pluggable Protocol Handler

Awesome Lists containing this project

README

          

Handle custom protocol schemes when you are using the `WebBrowser` control in a Windows Forms (or WPF) desktop application.

```C#
ProtocolFactory.Register("rsrc", () => new ResourceProtocol());
var html = @"";
Browser.DocumentText = html;
```

The `ResourceProtocol` class in the example above implements the following interface to deliver embedded resources to the browser control:

```C#
public interface IProtocol
{
string Name { get; }
Task GetStreamAsync(string url);
}
```