void ls_loginCompleted(object sender, LeagueWS.loginCompletedEventArgs e) { try { if (e.Result) { lsUser = new LeagueWS.LeagueServiceClient(); lsUser.encontrarUsuarioCompleted += ls_encontrarUsuarioCompleted; var settings = IsolatedStorageSettings.ApplicationSettings; if (settings.Count > 0 && settings["Login"].ToString() != "") { lsUser.encontrarUsuarioAsync(settings["Login"].ToString()); } else { lsUser.encontrarUsuarioAsync(nomeInvocador.Text); } } else { MessageBox.Show("Login não efetuado"); } } catch (Exception ex) { MessageBox.Show(ex.InnerException.Message); } finally { ls.CloseAsync(); } }
private async void buttonCadastro_Click(object sender, RoutedEventArgs e) { if (nomeInvocador.Text == string.Empty) { MessageBox.Show("Digite o nome do invocador antes de se cadastrar."); } else { summoner = new SummonerDto(); try { summoner = await summoner.SearchSummoner(nomeInvocador.Text); ls = new LeagueWS.LeagueServiceClient(); ls.encontrarUsuarioCompleted += Ls_encontrarUsuarioCompleted; ls.encontrarUsuarioAsync(nomeInvocador.Text); } catch (Exception) { MessageBox.Show("Erro ao procurar invocador."); } } }
private void buttonFinalizarCadastro_Click(object sender, RoutedEventArgs e) { ls = new LeagueWS.LeagueServiceClient(); ls.encontrarUsuarioCompleted += Ls_encontrarUsuarioCompleted; ls.encontrarUsuarioAsync(NavigationContext.QueryString["summoner"]); }