Inheritance: Cocoa.Object
Ejemplo n.º 1
0
		public void OnReceivedResponse(WebView sender, NSObject identifier, NSUrlResponse responseReceived, WebDataSource dataSource)
		{
			Console.WriteLine("OnReceivedResponse: {0}", responseReceived.ExpectedContentLength);
		}
Ejemplo n.º 2
0
        public URLRequest RequestHandler(WebView sender, Cocoa.Object identifier, URLRequest initialRequest, URLResponse urlResponse, WebDataSource datasource)
        {
            //		if ( ((URL)(initialRequest.urL)).relativeString.ToString().IndexOf("http://monodoc/load?") == 0) {
            // FIXME
            if (initialRequest.URL.AbsoluteString.IndexOf ("http://monodoc/load?") == 0) {
            string url = initialRequest.URL.AbsoluteString.Replace("http://monodoc/load?", "");
            string content = "";
            if (url.StartsWith ("edit:")) {
            //				XmlNode edit_node = EditingUtils.GetNodeFromUrl (url, help_tree);
            //				Console.WriteLine (edit_node.InnerXml);
            }

            Node n;
            try {
                content = help_tree.RenderUrl(url, out n);
            } catch (Exception e) {
                content = "Exception Rendering the requested URL: " + e;
            }
            if(content != null && !content.Equals("")) {
                content=content.Replace("a href='", "a href='http://monodoc/load?");
                content=content.Replace("a href=\"", "a href=\"http://monodoc/load?");
                webView.Render (content);
                addHistoryItem(url);
            }
            return null;
            }
            return initialRequest;
        }
Ejemplo n.º 3
0
		public void OnReceivedContentLength(WebView sender, NSObject identifier, nint length, WebDataSource dataSource)
		{
			Console.WriteLine("OnReceivedContentLength: {0}", length);
			InvokeOnMainThread(() => {
				progressBar.IncrementBy(2.5);
			});
		}