Esempio n. 1
0
 private async Task <string> GetXSLT()
 {
     using (var progress = DialogHelper.ShowProgress(AppResources.LOADING_DOCUMENT))
     {
         if (Xslt == null)
         {
             try
             {
                 Xslt = await HttpRequest.GetStr(EndPointHelper.GetXSLT());
             }
             catch (Exception e)
             {
                 //caso não seja possível obter o xslt, utiliza a versão embutida na app.
                 var localFileLoader = DependencyService.Get <IResourceLoader>();
                 using (Stream streamXslt = localFileLoader.OpenFile("documento.xsl"))
                 {
                     Xslt = StreamHelper.StreamToString(streamXslt);
                 }
             }
         }
         return(Xslt);
     }
 }