Click or drag to resize
IOutputWindowService Interface
This interface provides access to named panes in the Output window.

Namespace: Tvl.VisualStudio.OutputWindow.Interfaces
Assembly: Tvl.VisualStudio.OutputWindow.Interfaces (in Tvl.VisualStudio.OutputWindow.Interfaces.dll) Version: 2.0.1.0-dev
Syntax
public interface IOutputWindowService

The IOutputWindowService type exposes the following members.

Methods
  NameDescription
Public methodCode exampleTryGetPane
Gets the output window pane with the specified name.
Top
Remarks
This is a MEF component, and should be imported with the following attribute.
[Import]
Examples
The following example shows how to import and use this service.
  1. Import an IOutputWindowService, which is used to access named panes in the output window.
    C#
    [Import]
    internal IOutputWindowService OutputWindowService { get; set; }
  2. Use the TryGetPane(String) method to obtain the desired IOutputWindowPane, and then write to the pane using the Write(String) or WriteLine(String) method. This example writes a line of text to the General pane, one of the standard panes provided by Visual Studio.
    C#
    IOutputWindowPane pane = OutputWindowService.TryGetPane(PredefinedOutputWindowPanes.General);
    if (pane != null)
    {
      pane.WriteLine("This text appears in the General pane of the Output Window.");
    }
Thread Safety
The service implementing this interface ensures the TryGetPane(String) method is safe for use in multi-threaded extension code. However, calls to this method from non-UI threads may block while the main thread processes the request.
See Also