private void Search() { HttpRequester requester = new HttpRequester(); string url = String.Format(ONELOOK_URL, this._searchText); string result = requester.Get(url); MatchCollection matches = Regex.Matches(result, WORD_NET_WORD); string words = String.Format(FORMATTED_HEADER, this._searchText); foreach (Match match in matches) { words += String.Format(FORMATTED_VOCABULARY_CONTENT, match.Value); } InternalResourceReader reader = new InternalResourceReader(Assembly.GetExecutingAssembly()); string css = String.Format(FORMATTED_CSS_CONTENT, reader.ReadAllText("Onelooker.style.css")); words += css; if (matches.Count > 0) _webBrowser.DocumentText = words; else _webBrowser.DocumentText = words + NOT_FOUND; }
private string GetSearchingContent() { HttpRequester requester = new HttpRequester(); string url = String.Format(ONELOOK_URL, this._searchText); string result = String.Empty; try { result = requester.Get(url); } catch (Exception) { } MatchCollection matches = Regex.Matches(result, WORD_NET_WORD); string words = GetHeader(); foreach (Match match in matches) { words += String.Format(FORMATTED_VOCABULARY_CONTENT, match.Value); } if (matches.Count > 0) return words; else return words + NOT_FOUND; }