/// <summary> /// Initializes a new instance of the <see cref="BrowseSolutions"/> class. /// </summary> /// <param name="tfsUrl">The TFS URL.</param> /// <param name="searchCriteria">The search criteria.</param> public BrowseSolutions(string tfsUrl, TFSLabel searchCriteria) { this.tfsUrl = tfsUrl; this.InitializeComponent(); this.btnSelectLabel.Enabled = false; this.ValidSearchCriteria = searchCriteria; this.txtLabelFilter.Text = searchCriteria.LabelName; this.txtOwnerFilter.Text = searchCriteria.OwnerName; }
/// <summary> /// Gets the selected criteria. /// </summary> private void GetSelectedCriteria() { this.ValidSearchCriteria = new TFSLabel { LabelName = this.gdvTFSLabels.SelectedRows[0].Cells[0].Value.ToString(), OwnerName = this.gdvTFSLabels.SelectedRows[0].Cells[1].Value.ToString() }; }
/// <summary> /// Handles the Click event of the btnFind control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> private void BtnFind_Click(object sender, EventArgs e) { try { TFSLabel criteria = new TFSLabel { LabelName = txtLabelFilter.Text.Trim(), OwnerName = txtOwnerFilter.Text }; criteria.Validate(); if (!backgroundWorker1.IsBusy) { backgroundWorker1.RunWorkerAsync(criteria); } } catch (ArgumentException ex) { ex.ShowUIException(); this.txtLabelFilter.Focus(); this.txtLabelFilter.SelectAll(); } }