Ejemplo n.º 1
0
        private void ShowComposer(Func <string, Task> workFn)
        {
            var composer = new MarkdownComposerViewController();

            composer.PresentAsModal(this, async text =>
            {
                var hud = composer.CreateHud();

                using (UIApplication.SharedApplication.DisableInteraction())
                    using (_networkActivityService.ActivateNetwork())
                        using (hud.Activate("Commenting..."))
                        {
                            try
                            {
                                await workFn(text);
                                composer.DismissViewController(true, null);
                            }
                            catch (Exception e)
                            {
                                AlertDialogService.ShowAlert("Unable to Comment", e.Message);
                            }
                        }
            });
        }
Ejemplo n.º 2
0
 public Task <IResponse> Send(IRequest request, System.Threading.CancellationToken cancellationToken)
 {
     request.Headers["Accept"] = "application/vnd.github.v3+json; charset=utf-8";
     using (_networkActivity.ActivateNetwork())
         return(_httpClient.Send(request, cancellationToken));
 }
Ejemplo n.º 3
0
 public System.Threading.Tasks.Task <StoreKit.SKProductsResponse> RequestProductData(params string[] productIds)
 {
     using (_networkActivity.ActivateNetwork())
         return(_inAppPurcahseService.RequestProductData(productIds));
 }
Ejemplo n.º 4
0
 public async Task <IResponse> Send(IRequest request, System.Threading.CancellationToken cancellationToken)
 {
     using (_networkActivity.ActivateNetwork())
         return(await _httpClient.Send(request, cancellationToken));
 }