private void onDomClick(object sender, Gecko.DomEventArgs e) { if (sender == null || e == null || e.Target == null) { return; } Gecko.GeckoHtmlElement element = (Gecko.GeckoHtmlElement)e.Target.CastToGeckoElement(); if (element == null) { return; } string pattern = @"\d+([.,]\d{1,3})?\s*$"; Regex rgx = new Regex(pattern, RegexOptions.IgnoreCase); // collect numbers A Match match = rgx.Match(element.TextContent); double number; if (Double.TryParse(match.Value.Replace(',', '.'), out number)) { OnTextCaptured(new TextCapturedEventArgs() { Odd = number }); } }
private void browser_DOMContentLoaded(object sender, Gecko.DomEventArgs e) { // Inject our custom CSS and Javascript to make the app look pretty. if (browser.Tag == null) { browser.Tag = "Modified"; browser.Document.Head.InnerHtml += String.Format("<style>{0}</style>", Properties.Resources.CSS); browser.Document.Head.InnerHtml += String.Format("<script>{0}</script>", Properties.Resources.Script); } }
//private void checkBox1_CheckedChanged(object sender, EventArgs e) //{ // //this.panel1.Visible = checkBox1.Checked; //} //private void checkBox2_CheckedChanged(object sender, EventArgs e) //{ // //mLabel = checkBox2.Checked; // drawMap(mCurrentIndex); //} private void geckoWebBrowser1_Load(object sender, Gecko.DomEventArgs e) { }