Task <MediatR.Unit> IRequestHandler <WorkDoneProgressCancelParams, MediatR.Unit> .Handle( WorkDoneProgressCancelParams request, CancellationToken cancellationToken) { if (_activeObservers.TryGetValue(request.Token, out var item)) { item.Dispose(); } return(MediatR.Unit.Task); }
Task <MediatR.Unit> IRequestHandler <WorkDoneProgressCancelParams, MediatR.Unit> .Handle( WorkDoneProgressCancelParams request, CancellationToken cancellationToken) { if (_activeObserverTokens.TryRemove(request.Token, out var cts)) { cts.Cancel(); } _activeObservers.TryRemove(request.Token, out var observer); return(MediatR.Unit.Task); }
Task <Unit> IRequestHandler <WorkDoneProgressCancelParams, Unit> .Handle( WorkDoneProgressCancelParams request, CancellationToken cancellationToken ) { if (request.Token == null) { return(Unit.Task); } if (_activeObserverTokens.TryRemove(request.Token, out var cts)) { cts.Cancel(); } _activeObservers.TryRemove(request.Token, out _); return(Unit.Task); }
public abstract Task <Unit> Handle(WorkDoneProgressCancelParams request, CancellationToken cancellationToken);
public static void Cancel(this ILanguageServerWindowProgress mediator, WorkDoneProgressCancelParams @params) { mediator.SendNotification(@params); }
public override Task <Unit> Handle(WorkDoneProgressCancelParams request, CancellationToken cancellationToken) => _handler.Invoke(request, cancellationToken);