Beispiel #1
0
 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;
 }
Beispiel #2
0
 private string GetHeader()
 {
     InternalResourceReader reader = new InternalResourceReader(Assembly.GetExecutingAssembly());
     string header = String.Format(FORMATTED_CSS_CONTENT, reader.ReadAllText("Onelooker.style.css"));
     return header + String.Format(FORMATTED_HEADER, this._searchText);
 }