Exemplo n.º 1
0
        public bool Initialize()
        {
            html_panel           = new BrowserWidget();
            html_panel.Realized += delegate(object sender, EventArgs e)
            {
                html_panel.browser.NavigationRequested += delegate(object sender1, NavigationRequestedEventArgs e1)
                {
                    url = CheckUrl(e1.Uri);
                    // if the file is cached on disk, return
                    if (url.StartsWith("file:///") || url.StartsWith("javascript:", StringComparison.InvariantCultureIgnoreCase))
                    {
                        return;
                    }

                    if (UrlClicked != null)
                    {
                        UrlClicked(this, new EventArgs());
                    }
                    e1.Cancel = true;
                };
                html_panel.browser.StatusChanged += delegate(object sender1, StatusChangedEventArgs e1)
                {
                    url = e1.Message;
                    if (OnUrl != null)
                    {
                        OnUrl(this, new EventArgs());
                    }
                };
            };
            cache_imgs = new Hashtable();
            tmpPath    = Path.Combine(Path.GetTempPath(), "monodoc");
            return(html_panel.browser.Initialized);
        }
		public bool Initialize ()
		{
			html_panel = new BrowserWidget ();
			html_panel.Realized += delegate (object sender, EventArgs e) {
				html_panel.browser.NavigationRequested += delegate (object sender1, NavigationRequestedEventArgs e1) {

					url = CheckUrl (e1.Uri);
					// if the file is cached on disk, return
					if (url.StartsWith ("file:///") || url.StartsWith("javascript:", StringComparison.InvariantCultureIgnoreCase))
						return;

					if (UrlClicked != null)
						UrlClicked (this, new EventArgs());
					e1.Cancel = true;
				};
				html_panel.browser.StatusChanged += delegate (object sender1, StatusChangedEventArgs e1) {
					url = e1.Message;
					if (OnUrl != null)
						OnUrl (this, new EventArgs ());
				};
			};
			cache_imgs = new Hashtable();
			tmpPath = Path.Combine (Path.GetTempPath (), "monodoc");
			return html_panel.browser.Initialized;
		}