Ejemplo n.º 1
0
        public void Retorno(Fala procurada)
        {
            this.contador = procurada.numeroDaFala - 1;
            this.retorno  = procurada;

            lbFala.Text    = legenda.ArrumaFala(procurada.fala);
            lbFala.Visible = true;
            txbFala.Text   = "";
        }
Ejemplo n.º 2
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            ListView.SelectedListViewItemCollection selecionado = listViewLegendas.SelectedItems;

            if (selecionado.Count == 0)
            {
                MessageBox.Show("Favor selecione alguma fala.", "Pesquisa", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            else
            {
                Fala retorno = listLegendas.Find(x => x.tempoInicio.ToString() == selecionado[0].Text);

                formulario.Retorno(retorno);

                this.Close();
            }
        }
Ejemplo n.º 3
0
        private void LeArquivo(string arquivo)
        {
            StreamReader sr = new StreamReader(arquivo, Encoding.GetEncoding(28591));

            string arq = sr.ReadToEnd();

            falas = arq.Split('\n', '\r').Where(x => x != "").ToList();

            sr.Close();

            int    numeroFala, i = 0, contadorFala = 1;
            string textoLegenda = "";

            while (i < falas.Count)
            {
                if (int.TryParse(falas[i], out numeroFala) && numeroFala == contadorFala)
                {
                    int j = i + 2;

                    while (j != falas.Count - 1 && !int.TryParse(falas[j], out numeroFala))
                    {
                        if (numeroFala != contadorFala + 1)
                        {
                            textoLegenda += falas[j] + '\n';

                            j++;
                        }
                    }

                    Fala legenda = new Fala(falas[i + 1], i + 1, contadorFala, textoLegenda);
                    listaFalas.Add(legenda);
                    textoLegenda = "";
                    i            = j;
                    contadorFala++;
                }
                else
                {
                    i++;
                }
            }
        }