| IOutputWindowService Interface |
This interface provides access to named panes in the Output window.
Namespace: Tvl.VisualStudio.OutputWindow.InterfacesAssembly: Tvl.VisualStudio.OutputWindow.Interfaces (in Tvl.VisualStudio.OutputWindow.Interfaces.dll) Version: 2.0.1.0-dev
Syntax public interface IOutputWindowService
Public Interface IOutputWindowService
public interface class IOutputWindowService
type IOutputWindowService = interface end
The IOutputWindowService type exposes the following members.
Methods
| Name | Description |
---|
| TryGetPane |
Gets the output window pane with the specified name.
|
TopRemarks
This is a MEF component, and should be imported with the following attribute.
Examples
The following example shows how to import and use this service.
-
Import an IOutputWindowService, which is used to access named panes in the output window.
[Import]
internal IOutputWindowService OutputWindowService { get; set; }
-
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.
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