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();
            }
        }
Beispiel #2
0
 protected override void Show(OperationContext context)
 {
     lock (context.CustomData)
         PreventRepetitiveExecutionsHelper.SetIsRunning(context.CustomData, true);
 }
Beispiel #3
0
 protected override void Hide(OperationContext context, OperationStatus status)
 {
     lock (context.CustomData)
         PreventRepetitiveExecutionsHelper.SetIsRunning(context.CustomData, false);
 }