private void indexadorButton_Click(object sender, EventArgs e) { try { ExemploIndexador teste = new ExemploIndexador(5); teste.Adicionar("banana"); teste.Adicionar("laranja"); teste.Adicionar("uva"); teste.Adicionar("maçã"); teste.Adicionar("manga"); MessageBox.Show(teste[2]); for (int i = 0; i < teste.NumeroDePosicoes(); i++) { listBox1.Items.Add(teste[i]); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void button1_Click(object sender, EventArgs e) { try { ExemploIndexador teste = new ExemploIndexador(4); teste.Adicionar("elemento 1"); teste.Adicionar("elemento 2"); teste.Adicionar("elemento 3"); teste.Adicionar("elemento 4"); MessageBox.Show(teste[2].ToString()); for (int i = 0; i < teste.NumeroDePosicoes(); i++) { listBox1.Items.Add(teste[i]); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void button1_Click(object sender, EventArgs e) { try { ExemploIndexador teste = new ExemploIndexador(4); teste.Adicionar("elemento 1"); teste.Adicionar("elemento 2"); teste.Adicionar("elemento 3"); teste.Adicionar("elemento 4"); MessageBox.Show(teste[2].ToString()); for (int i = 0; i < teste.NumeroDePosicoes(); i++) { listBox1.Items.Add(teste[i]); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void indexadorButton_Click(object sender, EventArgs e) { try { ExemploIndexador teste = new ExemploIndexador(5); teste.Adicionar("banana"); teste.Adicionar("laranja"); teste.Adicionar("uva"); teste.Adicionar("maçã"); teste.Adicionar("manga"); MessageBox.Show(teste[2]); for (int i = 0; i < teste.NumeroDePosicoes(); i++) { listBox1.Items.Add(teste[i]); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }