Coding
Checking your Source Code and CommentsSlickEdit Editing Toolbox
Classify
CodeKeep
SharpTools
More...
Documentation
GhostDocClass Designer Powertoy
Navigation
VSMouseBindingsVSCmdShell
Research
CR PluginDevMetrics
Reflector Add-in
Regexinator
Unit Testing
TestDriven.NETSharpTools
Written by: Jim Holmes at 3/1/2008 10:36:27 PMSharpTools from Morrison Schwartz gives developers a framework for easily developing add-ins for Visual Studio .NET 2003. SharpTools also comes with a number of very handy tools as part of the basic install package.
Developers can rapidly tack on new functionality by creating plug-ins for SharpTools. Note that SharpTools is itself an add-in to Visual Studio. Developers extend SharpTools via plug-ins to SharpTools, not by creating new add-ins to Visual Studio. This means you’ll always be running your tools within SharpTools – and you’ll need to deploy SharpTools to any systems you want to run your new tools on.
Plug-ins are quickly spun up by creating a new C# SharpTool Wizard project, added during SharpTools installation.

As shown below, a one-screen wizard prompts you for a couple options.

The plug-in then creates a new project complete with references and a fairly complete class for your plug-in. Obviously, you’ll still need to wire up your widget’s functionality, but all the interfacing to Visual Studio .NET has been handled already. SharpTools also comes with a fair number of already built plug-ins. Perhaps the most useful of these tools is the Code Library for storing documentation and code in a database. The database can be a local MSDE or SQL instance, or you can connect and share data with other developers via a central SQL server database.
A neat feature is keyword support, whereby snippets or documentation can be inserted directly into the VS editor by typing the keyword and then CTRL-ENTER. Former Emacs users might remember abbreviation mode when thinking of this SharpTool functionality. The library comes already populated with quite a few snippets and an example of using the library for storing documentation.

Another feature is a tool for generates strongly-typed collections. A dialog lets you select which class to use, asks for access specifiers, and checks if you want the collection to raise events for various actions.

The tool creates a new class with a great amount of functionality and documentation built in. This snippet below shows a partial class generated from a simple business entity:
/// Represents a collection of <see cref='WindowsApplication1.Person'/> objects.
/// </summary>
// This class was created on 9/13/2005 by the SharpTools CollectionBuilder Addin.
public class PersonCollection : System.Collections.ICollection
{
// Provides the base object storage used by this class
private System.Collections.ArrayList items;
// This version counter is incremented any time the collection changes.
private int listVersion;
/// <summary>
/// Initializes a new instance of the <see cref='WindowsApplication1.PersonCollection'/> class.
/// </summary>
public PersonCollection()
{
items = new System.Collections.ArrayList();
listVersion = 0;
}
/// <summary>
/// Returns a number that can be used to determine if the collection has changed since some previous
/// reference point, since this value changes each time the collection is modified in any way.
/// </summary>
internal int Version
{
get
{
return listVersion;
}
}
/// <summary>
/// Gets the number objects contained in the collection.
/// <summary>
public virtual int Count
{
get
{
return items.Count;
}
}
/// <summary>
/// Gets a value indicating whether access to the collection is synchronized (thread-safe).
/// <summary>
public virtual bool IsSynchronized
{
get
{
return items.IsSynchronized;
}
}
}
There are quite a few other simpler tools included in SharpTools’ default install. You can search Google for a highlighted term or phrase, zip the entire solution into one archive, capture screen shots of your application (but only during execution, not design), and add copyright notice (or headers) to all files in a project.
Folks with a background in Win32 development will appreciate the Win32 to .NET mapping tool. This lets you browse through the Win32 API and see what parts of the Framework are applicable. Additionally, there’s a database manager for MSDE instances, something Microsoft left out of the distribution.
Another tool let you view DataSet objects during debugging sessions, much like VS2005’s visualizers. There’s also an RSS Reader tool which will let you read RSS feeds from within Visual Studio.
The binaries for SharpTools are free for download and installation, but donations via PayPay are encouraged. The source code is available for $50. There’s also a group of forums for discussing SharpTools. The forums are actively supported by developers from Morrison Schwartz.
blog comments powered by Disqus