Esempio n. 1
0
        public TefLinhaLista AguardaRespostaRequisicao()
        {
            var tempoInicioEspera = DateTime.Now;

            bool interromper;
            bool existeArquivoResposta;

            do
            {
                Thread.Sleep(EsperaSleep);

                var aguardandoResposta = new AguardaRespostaEventArgs(ArquivoResposta, tempoInicioEspera);
                OnAguardandoResposta(aguardandoResposta);

                interromper           = aguardandoResposta.Interromper;
                existeArquivoResposta = Arquivo.Existe(ArquivoResposta);
            } while (!existeArquivoResposta && !interromper);


            var tefLinhas = TefLinhaLista.LoadArquivo(ArquivoResposta);

            EfetuarBackup(tefLinhas);
            Arquivo.Deletar(ArquivoResposta);

            return(tefLinhas);
        }
Esempio n. 2
0
        private void AguardarRequisicao()
        {
            var tempoFimEspera = DateTime.Now.AddSeconds(EsperaSts);

            bool interromper;
            bool existeArquivoSts;
            bool timeOut;

            do
            {
                Thread.Sleep(EsperaSleep);

                var aguardandoResposta = new AguardaRespostaEventArgs(ArquivoSts, tempoFimEspera);
                OnAguardandoResposta(aguardandoResposta);

                interromper      = aguardandoResposta.Interromper;
                existeArquivoSts = Arquivo.Existe(ArquivoSts);
                timeOut          = DateTime.Now > tempoFimEspera;
            } while (!existeArquivoSts && !interromper && !timeOut);

            AcTefException.Quando(!Arquivo.Existe(ArquivoSts), "O gerenciador padrão TEFDial não está ativo!");
        }
Esempio n. 3
0
 public void OnAguardandoResposta(AguardaRespostaEventArgs e)
 {
     throw new NotImplementedException();
 }
Esempio n. 4
0
 private void AguardandoResposta(object sender, AguardaRespostaEventArgs e)
 {
     Console.Out.WriteLine(e.ArquivoSts);
     Console.Out.WriteLine($"Segundos: {e.Segundos}");
 }
Esempio n. 5
0
 public void OnAguardandoResposta(AguardaRespostaEventArgs e)
 {
     AguardandoResposta?.Invoke(this, e);
 }