public async static Task <RemoteCodeLensConnectionHandler> CreateAsync(DpdtCodeLensDataPoint owner, int vspid) { var handler = new RemoteCodeLensConnectionHandler(owner, vspid); await handler.ConnectAsync().ConfigureAwait(false); return(handler); }
public RemoteCodeLensConnectionHandler(DpdtCodeLensDataPoint owner, int vspid) { _owner = owner; _stream = new NamedPipeClientStream( serverName: ".", CodeLensPipeName.Get(vspid), PipeDirection.InOut, PipeOptions.Asynchronous ); }
public async Task <IAsyncCodeLensDataPoint> CreateDataPointAsync(CodeLensDescriptor descriptor, CodeLensDescriptorContext context, CancellationToken token) { try { var dp = new DpdtCodeLensDataPoint( _callbackService.Value, descriptor ); var vspid = await _callbackService.Value .InvokeAsync <int>(this, nameof(IDpdtCodeLensListener.GetVisualStudioPid)) .ConfigureAwait(false) ; await dp.ConnectToVisualStudioAsync(vspid).ConfigureAwait(false); return(dp); } catch (Exception ex) { LogCL(ex); throw; } }