async Task OnDeactivate(RevaleeRequestException exception) { //Trace.TraceError("A Revalee recurring task could not be scheduled."); if (_currentState.TransitionToInactive()) { await Start(); _option?.TaskEvent.Deactivated(new DeactivationEventArgs(exception)); } }
protected void OnDeactivate(RevaleeRequestException exception) { Trace.TraceError("A Revalee recurring task could not be scheduled."); if (_CurrentState.TransitionToInactive()) { this.Start(); EventHandler <DeactivationEventArgs> handler = Deactivated; if (handler != null) { handler(this, new DeactivationEventArgs(exception)); } } }
private void OnDeactivate(RevaleeRequestException exception) { Trace.TraceError("A Revalee recurring task could not be scheduled."); if (_CurrentState.TransitionToInactive()) { Task.Factory.StartNew(() => { Thread.Sleep(2000); this.Start(); }); Deactivated.Invoke(this, new DeactivationEventArgs(exception)); } }
/// <summary> /// Creates an instance of the <see cref="T:Revalee.Client.RecurringTasks.DeactivationEventArgs"/> class. /// </summary> /// <param name="exception">A <see cref="T:Revalee.Client.RevaleeRequestException"/> that is the cause of the deactivation.</param> public DeactivationEventArgs(RevaleeRequestException exception) { this.Exception = exception; }
protected void OnDeactivate(RevaleeRequestException exception) { Trace.TraceError("A Revalee recurring task could not be scheduled."); if (_CurrentState.TransitionToInactive()) { this.Start(); EventHandler<DeactivationEventArgs> handler = Deactivated; if (handler != null) { handler(this, new DeactivationEventArgs(exception)); } } }