Beispiel #1
0
        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);
        }
Beispiel #2
0
 public static WebBrowserProtocolFactory Register(this HProtocolBuilder builder, string protocolPrefix, Func <string, WebBrowserProtocolReaderContext, byte[]> reader, Guid?protocolId = null)
 {
     return(WebBrowserProtocolFactory.Register(protocolPrefix, reader, protocolId));
 }