Exemplo n.º 1
0
        private void BuscaButton_Click(object sender, EventArgs e)
        {
            var chave = BuscaTextBox.Text.Trim();

            if (!String.IsNullOrEmpty(chave))
            {
                BuscaDataGridView.Rows.Clear();

                this.Cursor  = Cursors.WaitCursor;
                this.Enabled = false;

                BuscaProgressBar.Maximum = this.buscas.Count;
                BuscaProgressBar.Value   = 0;
                BuscaProgressBar.Show();

                foreach (var busca in this.buscas)
                {
                    var b          = new Buscador(busca);
                    var resultados = b.buscar(chave);
                    resultados.ForEach(
                        r => BuscaDataGridView.Rows.Add(new String[] {
                        b.Nome,
                        b.TituloChave + " = " + r.chave,
                        b.TituloExibicao1 + " = " + r.exibicao1,
                        b.TituloExibicao2 + " = " + r.exibicao2
                    })
                        );

                    BuscaProgressBar.Value++;
                }

                this.Cursor  = Cursors.Default;
                this.Enabled = true;
                LimpaProgressoTimer.Enabled = true;
            }
        }
Exemplo n.º 2
0
 private void LimpaProgressoTimer_Tick(object sender, EventArgs e)
 {
     BuscaProgressBar.Hide();
     LimpaProgressoTimer.Enabled = false;
 }