private string GetSubjDesc(QuerySubject qs) { switch (qs) { case QuerySubject.Net: return("Net"); case QuerySubject.Part: return("Part"); case QuerySubject.Pin: return("Part.Pin"); case QuerySubject.Nail: return("Nail"); default: return(""); } }
public void Setup(QuerySubject subj, int queryCount, SearchCallback cb) { this.cb = cb; Text = "Find " + GetSubjDesc(subj); lStatus.Text = string.Empty; switch (subj) { case QuerySubject.Net: tbQuery1.AutoCompleteCustomSource = nets; tbQuery2.AutoCompleteCustomSource = nets; tbQuery3.AutoCompleteCustomSource = nets; break; case QuerySubject.Part: tbQuery1.AutoCompleteCustomSource = parts; tbQuery2.AutoCompleteCustomSource = parts; tbQuery3.AutoCompleteCustomSource = parts; break; case QuerySubject.Pin: tbQuery1.AutoCompleteCustomSource = pins; tbQuery2.AutoCompleteCustomSource = pins; tbQuery3.AutoCompleteCustomSource = pins; break; case QuerySubject.Nail: tbQuery1.AutoCompleteCustomSource = nails; tbQuery2.AutoCompleteCustomSource = nails; tbQuery3.AutoCompleteCustomSource = nails; break; } tbQuery1.Clear(); tbQuery2.Clear(); tbQuery3.Clear(); switch (queryCount) { case 1: tbQuery1.Visible = true; lQuery1.Visible = true; tbQuery2.Visible = false; lQuery2.Visible = false; tbQuery3.Visible = false; lQuery3.Visible = false; break; case 2: tbQuery1.Visible = true; lQuery1.Visible = true; tbQuery2.Visible = true; lQuery2.Visible = true; tbQuery3.Visible = false; lQuery3.Visible = false; break; case 3: tbQuery1.Visible = true; lQuery1.Visible = true; tbQuery2.Visible = true; lQuery2.Visible = true; tbQuery3.Visible = true; lQuery3.Visible = true; break; } tbQuery1.Focus(); }