private void SelectEntry(SearchResultEntry entry, bool showSolution) { foreach (SearchResultEntry entry2 in this.gpgPanelResults.Controls) { entry2.Unselect(); } entry.Select(); this.mSelectedEntry = entry; LinkedListNode<SearchResultEntry> node = this.EntryList.Find(entry); this.skinButtonLast.Enabled = node.Previous != null; this.skinButtonNext.Enabled = node.Next != null; this.gpgPanelResults.ScrollControlIntoView(this.SelectedEntry); if (showSolution) { base.MainForm.ShowDlgSolution(this.SelectedEntry.Solution); } }
public void RefreshResults() { EventHandler handler = null; if (this.ResultSet != null) { int num; this.gpgLabelResults.Text = string.Format(Loc.Get("<LOC>{0} results found"), this.ResultSet.Length); this.EntryList.Clear(); this.listBoxKeywords.DataSource = null; this.listBoxKeywords.DataSource = this.ResultSet[0].SearchWords; this.listBoxKeywords.SelectedIndices.Clear(); for (num = 0; num < this.listBoxKeywords.Items.Count; num++) { this.listBoxKeywords.SelectedIndices.Add(num); } this.gpgPanelResults.Controls.Clear(); for (num = 0; num < this.ResultSet.Length; num++) { SearchResultEntry entry = new SearchResultEntry(this.ResultSet[num]); entry.Width = this.gpgPanelResults.Width; entry.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top; entry.Location = new Point(0, num * entry.Height); this.EntryList.AddLast(entry); if (handler == null) { handler = delegate (object s, EventArgs me) { this.SelectEntry(s as SearchResultEntry, true); }; } entry.SolutionSelected += handler; this.gpgPanelResults.Controls.Add(entry); } } }