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