public static void CancelRequest(this IResponseRouter mediator, long id) { mediator.SendNotification(JsonRpcNames.CancelRequest, new CancelParams() { Id = id }); }
public static void CancelRequest(this IResponseRouter mediator, string id) { mediator.SendNotification(GeneralNames.CancelRequest, new CancelParams() { Id = id }); }
public void OnCompleted() { if (_disposable.IsDisposed) { return; } var @event = _onComplete?.Invoke() ?? new ProgressEndEvent { Message = "", ProgressId = ProgressId }; if (EqualityComparer <ProgressToken> .Default.Equals(@event.ProgressId, default)) { @event.ProgressId = ProgressId; } _router.SendNotification(@event); }
public void OnCompleted() { if (_disposable.IsDisposed) { return; } var @event = _onComplete?.Invoke() ?? new ProgressEndEvent { Message = "", ProgressId = ProgressId }; // ReSharper disable once ConditionIsAlwaysTrueOrFalse if (@event.ProgressId is null) { @event = @event with { ProgressId = ProgressId }; } _router.SendNotification(@event); } void IObserver <ProgressUpdateEvent> .OnError(Exception error) { if (_disposable.IsDisposed) { return; } var @event = _onError?.Invoke(error) ?? new ProgressEndEvent { Message = error.ToString(), ProgressId = ProgressId }; // ReSharper disable once ConditionIsAlwaysTrueOrFalse if (@event.ProgressId is null) { @event = @event with { ProgressId = ProgressId }; } _router.SendNotification(@event); }
public void OnNext(T value) { if (_isComplete) { return; } _responseRouter.SendNotification(new ProgressParams() { Token = ProgressToken, Value = JToken.FromObject(value, _serializer.JsonSerializer) }); }
public ProgressObserver( IResponseRouter router, ProgressStartEvent begin, Func <Exception, ProgressEndEvent> onError, Func <ProgressEndEvent> onComplete, CancellationToken cancellationToken ) { ProgressId = begin.ProgressId; _router = router; _onError = onError; _onComplete = onComplete; _disposable = new CompositeDisposable { Disposable.Create(OnCompleted) }; cancellationToken.Register(Dispose); _router.SendNotification(begin); }
public static void SendTelemetry(this IResponseRouter mediator, object @params) { mediator.SendNotification(TelemetryEvent, @params); }
public static void CancelRequest(this IResponseRouter mediator, string id) => mediator.SendNotification(new CancelParams { Id = id });
public static void CancelRequest(this IResponseRouter mediator, CancelParams @params) => mediator.SendNotification(@params);
public void SendNotification(string method) => _responseRouter.SendNotification(method);
public static void ShowMessage(this IResponseRouter mediator, ShowMessageParams @params) { mediator.SendNotification(WindowNames.ShowMessage, @params); }
public static void CancelRequest(this IResponseRouter mediator, CancelParams @params) { mediator.SendNotification(JsonRpcNames.CancelRequest, @params); }
public static void SendProgress <T>(this IResponseRouter mediator, ProgressToken token, T value, JsonSerializer jsonSerializer) { mediator.SendNotification(ProgressParams.Create <T>(token, value, jsonSerializer)); }
public static void SendProgress(this IResponseRouter mediator, ProgressParams @params) { mediator.SendNotification(@params); }
public void OnCompleted() => _router.SendNotification( _progressToken.Create(_onComplete?.Invoke() ?? new WorkDoneProgressEnd() { Message = "" }, _serializer.JsonSerializer) );
public static void PublishDiagnostics(this IResponseRouter mediator, PublishDiagnosticsParams @params) { mediator.SendNotification(DocumentNames.PublishDiagnostics, @params); }