예제 #1
0
        private void ExecuteElevateBlock(SelectableProduct p)
        {
            Task e = CoApp.Elevate();
            e.ContinueOnFail(ex =>
                                 {
                                     if (ex.InnerException != null)
                                         Logger.Warning("Elevate failed {0}, {1}", ex.InnerException.Message,
                                                        ex.InnerException.StackTrace);
                                     else
                                         Logger.Warning("Elevate failed {0}, {1}", ex.Message, ex.StackTrace);

                                     Messenger.Default.Send(NotEnoughPermissions());
                                 });

            e.Continue(() => Block.Execute(p));
        }
예제 #2
0
 private void ExecuteBlock(SelectableProduct p)
 {
     var t = _updateService.BlockProduct(p.Product);
     t.ContinueOnFail(e =>
                          {
                              Logger.Error(e);
                              if (e is RequiresPermissionException || (e.InnerException != null && e.InnerException is RequiresPermissionException))
                              {
                                  Messenger.Default.Send(NotEnoughPermissions());
                              }
                              Messenger.Default.Send(ProductStillBlocked());
                          });
 }