Home > Extensibility > Write in VS output window

Write in VS output window

Visual Studio had very nice extensibility features and very useful add-ons can be developed top of VS IDE. I decided to create an add-on for exploring the CodeModel of one of the projects which I developed before. usually the first add-on is a typical “Hello World” message, then its time to do some serious stuff.

One of the necessary things when creating add-ons for IDE is ability to write into output panels. This can be an efficient way of communicating to the developer instead of creating lots of MessageBoxes. Following code snippet will explain how to do so

EnvDTE.OutputWindowPane codeModelPane = null;
foreach (EnvDTE.OutputWindowPane pane in dte.ToolWindows.OutputWindow.OutputWindowPanes)
{
if (pane.Name == “NewPane”)
{
codeModelPane = pane;
}
}
if (codeModelPane == null)
codeModelPane = dte.ToolWindows.OutputWindow.OutputWindowPanes.Add(“NewPane”);

codeModelPane.OutputString(“A message for developer!”);

Microsoft Tutorials are quite useful for creating extensions for Visual Studio: http://msdn.microsoft.com/en-au/vsx/bb507746.aspx

Advertisements
Categories: Extensibility
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: