Using custom output panes

It is pretty simple to define, create and use custom output panes with VSXtra. This sample demonstates this.

Points of Interest:

  • You can directly write to the General pane of the Output window through System.Console.
  • Output window panes are defined by inheriting from the OutputPaneDefinition class. Custom pane properties are set through attributes decorating the class.
  • Panes can be accessed through the GetPane<TPane> method of the OutputWindow class.
Package source code:

using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using Microsoft.VisualStudio.Shell;
using VSXtra;

namespace DeepDiver.CustomOutputWindowPane
  [PackageRegistration(UseManagedResourcesOnly = true)]
  [InstalledProductRegistration(false, "#110", "#112", "1.0", IconResourceID = 400)]
  [ProvideLoadKey("Standard", "1.0", "CustomOutputWindowPane", "DeepDiver", 1)]
  public sealed class CustomOutputWindowPanePackage : PackageBase
    protected override void Initialize()
      Console.WriteLine("*** Turn to the CutomPane1 and CustomePane2 output panes!");
      var pane1 = OutputWindow.GetPane<CustomPane1>();
      pane1.WriteLine("Welcome on CustomPane1!");
      var pane2 = OutputWindow.GetPane<CustomPane2>();
      pane2.WriteLine("Welcome on CustomPane2!");

    class CustomPane1: OutputPaneDefinition {}

    class CustomPane2 : OutputPaneDefinition { }



Last edited Aug 7, 2008 at 1:39 PM by INovak, version 2


No comments yet.