void OnOutputWritten(object sender, OutputWrittenEventArgs e) { string storedOutputString = null; if (!this.outputPerType.TryGetValue(e.OutputType, out storedOutputString)) { this.outputPerType.Add(e.OutputType, null); } if (storedOutputString == null) { storedOutputString = e.OutputText; } else { storedOutputString += e.OutputText; } if (e.IncludeNewLine) { storedOutputString += Environment.NewLine; } this.outputPerType[e.OutputType] = storedOutputString; }
async void powerShellContext_OutputWritten(object sender, OutputWrittenEventArgs e) { await this.messageWriter.WriteEvent( OutputEvent.Type, new OutputEventBody { Output = e.OutputText + (e.IncludeNewLine ? "\r\n" : string.Empty), Category = (e.OutputType == OutputType.Error) ? "stderr" : "stdout" }); }
async void powerShellContext_OutputWritten(object sender, OutputWrittenEventArgs e) { await this.SendEvent( DebugAdapterMessages.OutputEvent.Type, new DebugAdapterMessages.OutputEventBody { Output = e.OutputText + (e.IncludeNewLine ? "\r\n" : string.Empty), Category = (e.OutputType == OutputType.Error) ? "stderr" : "stdout" }); }
async void powerShellContext_OutputWritten(object sender, OutputWrittenEventArgs e) { // Queue the output for writing await this.outputDebouncer.Invoke(e); }
private void OnConsoleOutputWritten(object sender, OutputWrittenEventArgs e) { var output = IoC.Get <IOutput>(); output.AppendLine("[" + e.OutputType + "] " + e.OutputText); }