public override Task <bool> CheckAsync(OperationContext context, CancellationToken cancellationToken)
        {
            lock (context.CustomData)
            {
                var running = PreventRepetitiveExecutionsHelper.IsRunning(context.CustomData);

                if (!running)
                {
                    PreventRepetitiveExecutionsHelper.SetIsRunning(context.CustomData, true);

                    return(Task.FromResult(true));
                }

                throw new OperationCanceledException();
            }
        }
Ejemplo n.º 2
0
 protected override void Show(OperationContext context)
 {
     lock (context.CustomData)
         PreventRepetitiveExecutionsHelper.SetIsRunning(context.CustomData, true);
 }
Ejemplo n.º 3
0
 protected override void Hide(OperationContext context, OperationStatus status)
 {
     lock (context.CustomData)
         PreventRepetitiveExecutionsHelper.SetIsRunning(context.CustomData, false);
 }