private async void CarregarFoto(string caminho)
        {
            var nome = Path.GetFileName(caminho);

            var foto = await ArmazenamentoHelper
                       .ConverterArquivoStreamAsync(nome);

            await ivm.EnviarFoto(nomearquivo, foto);
        }
Esempio n. 2
0
        public async Task <Stream> ObterFoto(string nomeArquivo)
        {
            Stream fotostream = null;

            bool existe = await ArmazenamentoHelper.ExisteArquivoAsync(nomeArquivo);

            if (existe == false)
            {
                fotostream = await srv.ObterFoto(nomeArquivo);

                if (srv.Resultado.Sucesso == true)
                {
                    // Salvar o arquivo local
                    await ArmazenamentoHelper.ConverterStreamArquivoAsync(nomeArquivo, null, fotostream);
                }
            }
            else
            {
                fotostream = await ArmazenamentoHelper.ConverterArquivoStreamAsync(nomeArquivo, null);
            }

            return(fotostream);
        }