Ejemplo n.º 1
0
        public virtual void SetContent(IWebResponse response, Content <Stream> content)
        {
            bool closeStream = this.IsStreamOwner;

            lock (lockObject) {
                closeStream = !response.IsStreamOwner;

                WebServer.ContentGetter = response.Getter(content);

                WebBrowser.MakeReady();
                if (UseProxy)
                {
                    var browserWithProxy = this.Backend as IWebBrowserWithProxy;
                    if (browserWithProxy != null)
                    {
                        browserWithProxy.SetProxy(WebServer.Addr, WebServer.Port, this.Backend);
                    }
                }

                WebBrowser.Navigate(response.AbsoluteUri);
                WebBrowser.WaitFor(() =>
                                   response.Done
                                   );

                Trace.WriteLine("Navigated to " + response.AbsoluteUri);
            }
        }