398
|
Chapter 12, Extending Visual Studio
#89 Writing a Visual Studio Add-in
HACK
{
}
VB.NET template
function OnFinish(selProj, selObj)
{
try
{
var strItemName = wizard.FindSymbol("ITEM_NAME");
var strTemplatePath = wizard.FindSymbol("TEMPLATES_PATH");
var strTemplateFile = strTemplatePath + "\\HTTPHandler.ashx";
var item = AddFileToVSProject(strItemName, selProj,
selObj, strTemplateFile, true);
return 0;
}
catch(e)
{
if( e.description.length > 0 )
SetErrorInfo(e);
return e.number;
}
}
Save the file as default.js in the Scripts/1033 folder of your wizard.
Try It Out
That’s it. Create a Visual Studio .NET 2003 Project. Bring up the Add New
Item dialog. The HTTP Handler item should appear as the second one in the
dialog box. Adjust the HTTPHandler1.aspx name if needed and click the
Open button. A new HTTPHandler.ashx file will appear in your project.
—Steven Dewalt
HACK
#89
Writing a Visual Studio Add-in Hack #89
Although the automation model can be more fun than a barrel of monkeys,
add-ins let you really extend the environment.
In this book, you have learned about a large number of different add-ins that
you can install to enhance the functionality of Visual Studio. In this hack,
you will learn how to write one of those add-ins. The topic of writing Visual
Studio add-ins can be, and has been, the topic of entire books, so needless to
say, this hack will simply be an introduction to the topic.
Add-ins are installable extensions to the Visual Studio IDE. Through add-
ins, you can accomplish quite a bit with the IDE. An excellent example of
this is TestDriven.NET
[Hack #93], an add-in that really adds significant func-
tionality to the IDE.

Get Visual Studio Hacks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.