private TextWriter CreateWriter(Guid id, string title) { var stringWriter = new StringWriter(); var writer = new StrategyTextWriter(stringWriter); shellEvents.Initialized += (sender, args) => { using (tracer.StartActivity(Strings.OutputWindowManager.TraceInitializing(title))) { IVsOutputWindowPane pane = GetVsPane(id, title); if (pane != null) { var outputWriter = new OutputWindowTextWriter(uiThread, pane); // Dump over the cached text from the initial writer. stringWriter.Flush(); outputWriter.Write(stringWriter.ToString()); // Replace the strategy, which will now write directly to the output pane. writer.StrategyWriter = outputWriter; } } }; return(writer); }
private TextWriter CreateWriter(Guid id, string title) { var stringWriter = new StringWriter(); var writer = new StrategyTextWriter(stringWriter); eventStream.Value.Of <ShellInitialized>().Subscribe(_ => { using (tracer.StartActivity(Strings.OutputWindowManager.TraceInitializing(title))) { IVsOutputWindowPane pane = GetVsPane(id, title); if (pane != null) { var outputWriter = new OutputWindowTextWriter(jtf, pane); // Dump over the cached text from the initial writer. stringWriter.Flush(); outputWriter.Write(stringWriter.ToString()); // Replace the strategy, which will now write directly to the output pane. writer.StrategyWriter = outputWriter; } } }); return(writer); }
private TextWriter CreateWriter(Guid id, string title) { var stringWriter = new StringWriter(); var writer = new StrategyTextWriter(stringWriter); shellEvents.Initialized += (sender, args) => { using (tracer.StartActivity(Strings.OutputWindowManager.TraceInitializing(title))) { IVsOutputWindowPane pane = GetVsPane(id, title); if (pane != null) { var outputWriter = new OutputWindowTextWriter(uiThread, pane); // Dump over the cached text from the initial writer. stringWriter.Flush(); outputWriter.Write(stringWriter.ToString()); // Replace the strategy, which will now write directly to the output pane. writer.StrategyWriter = outputWriter; } } }; return writer; }