Example #1
0
 public IAsyncOperationToken BeginBurn(IBurningReceipt Receipt, FirmwareProject Project)
 {
     var token = new BurningAsyncOperationToken(new ProgressProxy());
     RegisterCurrentOperation(token);
     Task.Factory.StartNew(() => Burn(Receipt, Project, token));
     _burningStartedEvent.Publish(new BurningStartedEventArgs(token));
     return token;
 }
Example #2
0
 private void Burn(IBurningReceipt Receipt, FirmwareProject Project, BurningAsyncOperationToken OperationToken)
 {
     using (_progressControllerFactory.CreateController(OperationToken.ProgressToken))
     {
         try
         {
             Receipt.Burn(Project, OperationToken.ProgressToken, OperationToken.CancellationToken);
             OperationToken.Success();
         }
         catch (CreateImageException exception)
         {
             OnException("Не удалось составить образ для прошивки", OperationToken, exception.InnerException, Project, Receipt);
         }
         catch (BurningException exception)
         {
             OnException("Не удалось прошить устройство", OperationToken, exception.InnerException, Project, Receipt);
         }
     }
 }
Example #3
0
 private void OnException(string ExceptionHeader, BurningAsyncOperationToken OperationToken, Exception Exc, FirmwareProject Project,
                          IBurningReceipt Receipt)
 {
     if (!_exceptionSuppressors.Any(s => s(Exc)))
         _exceptionService.PublishException(ExceptionHeader, Exc, Project, Receipt);
     OperationToken.Error(Exc);
 }
 public BurningMethodViewModel(string Name, IBurningReceipt Receipt)
 {
     this.Receipt = Receipt;
     this.Name = Name;
 }
Example #5
0
 public BurningMethod(IBurningReceipt Receipt)
 {
     this.Receipt = Receipt;
 }