public void ExecuteVersionSearch(IAdditionalContent content) { try { QuazalQuery query; this.SelectedContentList = null; if (content != null) { query = content.CreateVersionQuery(); if (!query.IsEmpty) { this.Searching = true; base.SetStatus("Searching...", new object[0]); this.ViewingVersionHistory = true; ThreadPool.QueueUserWorkItem(delegate (object s) { VGen0 method = null; DataList data = query.GetData(); List<IAdditionalContent> list2 = new List<IAdditionalContent>(data.Count); for (int j = 0; j < data.Count; j++) { IAdditionalContent item = MappedObject.FromData(this.SelectedDownloadContent.GetType(), data[j]) as IAdditionalContent; if (item.CurrentUserCanDownload) { list2.Add(item); } } this.SearchResults = list2.ToArray(); if (!this.Disposing && !this.IsDisposed) { if (method == null) { method = delegate { this.dataGridSearchResults.DataSource = null; this.dataGridSearchResults.DataSource = this.SearchResults; this.gvResults.InvalidateRows(); this.gpgGroupBoxResults.Text = Loc.Get("<LOC>Version History"); if (this.SearchResults.Length > 0) { this.skinLabelSearchPage.Text = string.Format(Loc.Get("<LOC>Page {0}"), this.SearchPage + 1); } else { this.skinLabelSearchPage.Text = Loc.Get("<LOC>No Results"); } this.ClearStatus(); this.Searching = false; }; } this.BeginInvoke(method); } }); } } } catch (Exception exception) { ErrorLog.WriteLine(exception); } }
private void skinButtonRunSearch_Click(object sender, EventArgs e) { this.SelectedContentList = null; this.SearchPage = 0; this.ExecuteSearch(); }
private void treeViewSavedSearches_AfterSelect(object sender, TreeViewEventArgs e) { if (((e.Node != null) && (e.Node.Tag != null)) && (e.Node.Tag is ContentList)) { this.SelectedContentList = e.Node.Tag as ContentList; this.SearchPage = 0; this.ExecuteSearch(); } }
private void SearchCriteriaTextBox_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Return) { this.SelectedContentList = null; this.SearchPage = 0; this.ExecuteSearch(); } }