public ContatosList() { gerenciadorDeContatos = new GerenciadorDeContatos(DependencyService.Get <IGerenciadorDeDownload>()); //Obtem os contatos do arquivo local Contatos = gerenciadorDeContatos.ObtemContatosDoArquivo(); InitializeComponent(); listaContatos.ItemsSource = Contatos; }
/// <summary> /// Verifica autorização de aparelho para usar o aplicativo /// </summary> /// <exception cref="ExcecaoDeAutenticacao">Erro de autenticação</exception> public static void Autorizar() { var gerenciadorDeContatos = new GerenciadorDeContatos(DependencyService.Get <IGerenciadorDeDownload>()); var imeisDoArquivo = gerenciadorDeContatos.ObtemImeis(); var listaDeImeiDoAparelho = DependencyService.Get <IGerenciadorDeImei>().ObtemImei(); bool result = (from imei in listaDeImeiDoAparelho where imeisDoArquivo.Contains(imei) select imei).Count() > 0; if (!result) { throw new ExcecaoDeAutenticacao("Seu IMEI " + listaDeImeiDoAparelho[0] + " não está cadastrado na agenda corporativa Stefanini. Por favor, entre em contato com o setor de Gestão de Telecom."); } }