public async static Task <VisualStudioConnectionHandler> Create(CodeLensDataPoint owner, int vspid)
        {
            var handler = new VisualStudioConnectionHandler(owner, vspid);
            await handler.Connect().Caf();

            return(handler);
        }
 public VisualStudioConnectionHandler(CodeLensDataPoint owner, int vspid)
 {
     this.owner = owner;
     stream     = new NamedPipeClientStream(
         serverName: ".",
         PipeName.Get(vspid),
         PipeDirection.InOut,
         PipeOptions.Asynchronous);
 }
Exemple #3
0
        public async Task <IAsyncCodeLensDataPoint> CreateDataPointAsync(
            CodeLensDescriptor descriptor,
            CodeLensDescriptorContext context,
            CancellationToken ct)
        {
            try {
                var dp = new CodeLensDataPoint(callbackService.Value, descriptor);

                var vspid = await callbackService.Value
                            .InvokeAsync <int>(this, nameof(IInstructionsProvider.GetVisualStudioPid)).Caf();

                await dp.ConnectToVisualStudio(vspid).Caf();

                return(dp);
            } catch (Exception ex) {
                LogCL(ex);
                throw;
            }
        }