/// <summary> /// Displays the results of the search. /// </summary> /// <param name="opt">The opt object holds the user-defined search options</param> private void ShowResults(Wnlib.Opt opt) { string tmpstr = ""; if (list.Count == 0) { showFeedback("Search for " + txtSearchWord.Text + " returned 0 results."); return; } Overview tmptbox = new Overview(); if ((!object.ReferenceEquals(pbobject.GetType(), tmptbox.GetType()))) { Overview tb = new Overview(); txtOutput.Text = ""; tb.useList(list, help, ref tmpstr); if ((help != null) & !string.IsNullOrEmpty(help)) { tmpstr = help + Constants.vbCrLf + Constants.vbCrLf + tmpstr; } tmpstr = Strings.Replace(tmpstr, Constants.vbLf, Constants.vbCrLf); tmpstr = Strings.Replace(tmpstr, Constants.vbCrLf, "", 1, 1); tmpstr = Strings.Replace(tmpstr, "_", " "); showFeedback(tmpstr); if (string.IsNullOrEmpty(tmpstr) | tmpstr == "<font color='green'><br />" + Constants.vbCr + " " + txtSearchWord.Text + " has no senses </font>") { showFeedback("Search for " + txtSearchWord.Text + " returned 0 results."); } txtOutput.Visible = true; pbobject = tb; } txtSearchWord.Focus(); if ((se != null)) { if (se.morphs.Count > 0) { // use morphs instead of se string wrd = null; list = new ArrayList(); foreach (string wrd_loopVariable in se.morphs.Keys) { wrd = wrd_loopVariable; // Build the treecontrol with the search results. // Node hierarchy is automatically constructed in the TreeControl. list.Add(se.morphs[wrd]); treeControl1.fillTree(list, false); } } else { // there are no morphs - all senses exist in se // Build the treecontrol with the search results. // Node hierarchy is automatically constructed in the TreeControl. list = new ArrayList(); list.Add(se); treeControl1.fillTree(list, false); } } }
/// <summary> /// Displays the results of the search. /// </summary> /// <param name="opt">The opt object holds the user-defined search options</param> private void ShowResults(Wnlib.Opt opt) { string tmpstr = ""; if (list.Count == 0) { showFeedback("Search for " + txtSearchWord.Text + " returned 0 results."); return; } Overview tmptbox = new Overview(); if ((!object.ReferenceEquals(pbobject.GetType(), tmptbox.GetType()))) { Overview tb = new Overview(); tb.useList(list, help, ref tmpstr); if ((help != null) & !string.IsNullOrEmpty(help)) { tmpstr = help + Constants.vbCrLf + Constants.vbCrLf + tmpstr; } tmpstr = Strings.Replace(tmpstr, Constants.vbLf, Constants.vbCrLf); tmpstr = Strings.Replace(tmpstr, Constants.vbCrLf, "", 1, 1); tmpstr = Strings.Replace(tmpstr, "_", " "); showFeedback(tmpstr); if (string.IsNullOrEmpty(tmpstr) | tmpstr == "<font color='green'><br />" + Constants.vbCr + " " + txtSearchWord.Text + " has no senses </font>") { showFeedback("Search for " + txtSearchWord.Text + " returned 0 results."); } pbobject = tb; } txtSearchWord.Focus(); if ((se != null)) { string outstr = ""; if (se.morphs.Count > 0) { // use morphs instead of se string wrd = null; foreach (string wrd_loopVariable in se.morphs.Keys) { wrd = wrd_loopVariable; // Build the output with the search results. // Node hierarchy is automatically constructed list = null; list[0] = se.morphs[wrd]; outstr = wnColour.buildContents(list); } } else { // there are no morphs - all senses exist in se // Build the output with the search results. // Node hierarchy is automatically constructed list[0] = se; outstr = wnColour.buildContents(list); } wnColour.Canvas.DocumentText = outstr; } }