//Metodos do controlador //Cria e controla a activity protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); //Exibindo o layout .axml SetContentView(Resource.Layout.Main); //chamando o serviço de conexao a internet, necessário fazer na activity var connectivityManager = (ConnectivityManager)GetSystemService(ConnectivityService); //pra verificar o tempo de checagem de conexao com o servidor _stopwatch.Start(); ChecagemConexao.ChecarConexão(this, connectivityManager); _stopwatch.Stop(); var tempoIniciarMain = _stopwatch; EnviarErro.EnviandoTempoIniciarMain(tempoIniciarMain); //Iniciando as variaveis do contexto var campoEmail = FindViewById <EditText>(Resource.Id.email); var campoSenha = FindViewById <EditText>(Resource.Id.senha); var entrar = FindViewById <Button>(Resource.Id.entrar); var inscrevase = FindViewById <Button>(Resource.Id.inscrevase); //Funcionalidades //Resgatando o que foi digitado nos EditText campoEmail.TextChanged += (sender, texto) => _emailInserido = texto.Text.ToString(); campoSenha.TextChanged += (sender, texto) => _senhaInserida = texto.Text.ToString(); entrar.Click += BotaoEntrarClique; inscrevase.Click += BotaoInscreverClique; }
//Metodos do controlador //Cria e controla a activity protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); //Exibindo o layout .axml SetContentView(Resource.Layout.Main); //chamando o serviço de conexao a internet, necessário fazer na activity var connectivityManager = (ConnectivityManager)GetSystemService(ConnectivityService); //pra verificar o tempo de checagem de conexao com o servidor var stopwatch = new Stopwatch(); stopwatch.Start(); ChecagemConexao.ChecarConexão(this, connectivityManager); stopwatch.Stop(); var tempoIniciarMain = stopwatch.ToString(); //Iniciando as variaveis do contexto var campoEmail = FindViewById <EditText>(Resource.Id.email); var campoSenha = FindViewById <EditText>(Resource.Id.senha); var entrar = FindViewById <Button>(Resource.Id.entrar); var inscrevase = FindViewById <Button>(Resource.Id.inscrevase); //Funcionalidades //Resgatando o que foi digitado nos EditText campoEmail.TextChanged += (sender, texto) => _emailInserido = texto.Text.ToString(); campoSenha.TextChanged += (sender, texto) => _senhaInserida = texto.Text.ToString(); stopwatch.Restart(); entrar.Click += ButtonEntrarClick; stopwatch.Stop(); var tempoLogar = stopwatch.ToString(); //Tenho que fazer a autenticação no banco de dados //Ideia é buscar usuario no banco, se existir retorna true e checa senha, se nao retorna usuario inexistente //Busca senha neste mesmo usuario, se for igual retorna true se nao retorna senha invalida stopwatch.Restart(); inscrevase.Click += ButtonInscreverClick; stopwatch.Stop(); var tempoIniciarInscrever = stopwatch.ToString(); }