public static WebBrowserProtocolFactory Register(string protocolPrefix, Func <string, WebBrowserProtocolReaderContext, byte[]> reader, Guid?protocolId = null) { IInternetSession session = null; CoInternetGetSession(0, ref session, 0); //Console.WriteLine(session); var _protocolId = protocolId ?? Guid.NewGuid(); var factory = new WebBrowserProtocolFactory(protocolPrefix, reader, _protocolId); session.RegisterNameSpace(factory, ref _protocolId, protocolPrefix, 0, null, 0); return(factory); }
public static WebBrowserProtocolFactory Register(this HProtocolBuilder builder, string protocolPrefix, Func <string, WebBrowserProtocolReaderContext, byte[]> reader, Guid?protocolId = null) { return(WebBrowserProtocolFactory.Register(protocolPrefix, reader, protocolId)); }