Ejemplo n.º 1
0
 public virtual Task FireAsync <TArgument>(ParameterizedTrigger <TTrigger, TArgument> parameterizedTrigger,
                                           TArgument argument)
 {
     return(!IsEnabled
         ? TaskHelpers.CompletedTask
         : AwaitableExecutionHelper.FireCoreAsync(parameterizedTrigger, argument, this));
 }
Ejemplo n.º 2
0
 public override async Task FireAsync(TTrigger trigger)
 {
     if (m_monitor.TryEnter())
     {
         try { await base.FireAsync(trigger).ConfigureAwait(false); }
         finally { m_monitor.Exit(); }
     }
     else
     {
         if (IsEnabled)
         {
             AwaitableExecutionHelper.ThrowInTransition();
         }
     }
 }
Ejemplo n.º 3
0
 public override async Task FireAsync <TArgument>(ParameterizedTrigger <TTrigger, TArgument> parameterizedTrigger,
                                                  TArgument argument)
 {
     if (m_monitor.TryEnter())
     {
         try { await base.FireAsync(parameterizedTrigger, argument).ConfigureAwait(false); }
         finally { m_monitor.Exit(); }
     }
     else
     {
         if (IsEnabled)
         {
             AwaitableExecutionHelper.ThrowInTransition();
         }
     }
 }
Ejemplo n.º 4
0
 public override async Task MoveToStateAsync(TState state,
                                             StateTransitionOption option = StateTransitionOption.Default)
 {
     if (m_monitor.TryEnter())
     {
         try { await base.MoveToStateAsync(state, option).ConfigureAwait(false); }
         finally { m_monitor.Exit(); }
     }
     else
     {
         if (IsEnabled)
         {
             AwaitableExecutionHelper.ThrowInTransition();
         }
     }
 }
Ejemplo n.º 5
0
 public virtual Task FireAsync(TTrigger trigger)
 {
     return(!IsEnabled ? TaskHelpers.CompletedTask : AwaitableExecutionHelper.FireCoreAsync(trigger, this));
 }
Ejemplo n.º 6
0
 public virtual Task MoveToStateAsync(TState state, StateTransitionOption option = StateTransitionOption.Default)
 {
     return(!IsEnabled
         ? TaskHelpers.CompletedTask
         : AwaitableExecutionHelper.MoveToStateCoreAsync(state, option, this));
 }