protected override void OnDocumentComplete(object sender, EventArgs args) { Method <string> .Watch("search match", () => { NLResult result = NatualLinkCreator.Instance.Create(this.hostBrowser.GetText(true), LinkStyle.Standard); CreateMatchAnchors(result.MatchWords); if (result.MatchWords.Count > 0) { IHTMLInputElement searchInput = browser.GetElementByID(true, "keyword") as IHTMLInputElement; searchInput.value = result.MatchWords[0]; } }); }
void browser_WBLButtonUp(object sender, csExWB.HTMLMouseEventArgs e) { MyBrowser hostBrowser = Host.Browser as MyBrowser; if (hostBrowser == null) { return; } IHTMLElement elem = e.SrcElement as mshtml.IHTMLElement; mshtml.HTMLImg img = elem as mshtml.HTMLImg; if (img != null && img.className == "select") { string text = img.parentElement.innerText; IHTMLInputElement searchInput = browser.GetElementByID(true, "keyword") as IHTMLInputElement; NLResult result = NatualLinkCreator.Instance.Create(text, LinkStyle.Standard); Clipboard.SetText(result.OutputText); AutoReplay(hostBrowser.LocationUrl, result.OutputText); this.Close(); } }