Introduction

 < Free Open Study > 



This book was written for the experienced Windows developer who wants to take advantage of the extensibility functionality of Visual Studio .NET. Extensibility has been around for several versions of Visual Studio. Extensibility is a big word for the way Visual Studio.NET allows developers to extend the functionality of the integrated development environment (IDE). Prior to the advent of .NET, Visual Studio had one IDE for C++ and a different one for Visual Basic (VBIDE). Now, as you probably already know, Visual Studio's IDE accommodates Visual C++, Visual Basic, and the new kid on the block, Visual C#, along with provisions for future languages. Consequently, add-ins can now be written in any of the three aforementioned languages, and the resulting add-ins can support the other languages, regardless of the language in which the add-in was created.

Some of you may be asking, "What's an add-in?" That's okay, you don't have to be experienced in writing, or even using, add-ins in order to benefit from this book. An add-in is a tool. Actually, it's a special type of DLL (.NET assembly) that you can create and compile using Visual Studio .NET's extensibility object model to extend and customize Visual Studio's IDE. The primary aim in writing an add- in is to automate tasks in the IDE that are difficult, repetitive, and tedious to accomplish without such a tool. Chapter 1 provides a detailed description of an add-in.

Why Do I Need to Write an Add-in?

Many of you reading this introduction are corporate developers. Many of you are contractors or consultants. Regardless of whether you are a corporate employee, contractor, consultant, or you have your own company (I am both a consultant and have my own company to write add-ins for commercial consumption), you get paid for production. I've found add-ins to be one of the best ways for me to increase my own productivity. When I can create an add-in that saves me time or makes me more productive, the company for which I am consulting or developing gets their applications done quicker, which saves them money. When companies save money, they make money. We've all heard the old saying, "A penny saved is a penny earned". However, now when you save a few minutes, you save a few dollars. Therefore, by saving dollars, you are making dollars for your employer.

Not only will add-ins allow you to save time, but also when you write an add- in that automates tasks you would normally do manually, the add-in does the job for which it was written and does it accurately every time. The add-in, if written properly, works just like any other well-written and debugged program. It does not make mistakes!

Just recently, I wrote an add-in that creates "wrapper" code around the XML DOM. The feature converts any number of class properties to and from an XML string. This allows the passing of one parameter, an XML string, instead of many parameters. I was moving code from the modules of a "fat client" client/server application to DLLs for use on an application server. Several forms had over 100 controls, and the prospect of marshalling 100-plus properties across DCOM was daunting. Because I had numerous forms to convert, I needed a tool to automate the creation and parsing of the parameters to and from XML. I spent 5 hours creating a new add-in that eliminated 30 to 40 hours of drudgery, not to speak of the errors that I would have introduced had I done the job manually.

Now, if you can write an add-in that automates tasks flawlessly and even generates error-free code, you have become more valuable to your employer. In my case, as a consultant, or contract programmer, I get paid for production. I get rewarded with extended contracts for above-average performance. Therefore, add-ins have been a great boon to my career for years.

Add-ins are a great way to enforce standards and consistency across a development team. For example, in one of the commercial add-ins that I have developed, VBCommander, there are numerous features that ensure consistency across a project. One instance of this is the Property Prompter. This feature displays a dialog box every time a control is dropped on a form. The Prompter automatically determines the type of control being placed and enters a predetermined prefix into a text box on the Prompter's dialog box, positioning the cursor just beyond the prefix so that the developer can directly enter the rest of the control's name. Depending on the type of control—a command button, for example—the Caption property (Text in .NET) may be automatically created and the first character of the caption will be preceded by an ampersand (&), causing it to be underlined on the command button when it appears on the form. These and other properties that the developer would have to go to the property page and enter manually are automatically prompted for and in some cases suggested or supplied.

Another important feature that is used constantly is block commenting. The add-in not only comments a block of code (the IDE obviously has this feature), but it also encapsulates the selected block with a header and footer that includes the developer's name and the date of the change. There are several options in the Comment menu of the add-in that not only allow you to comment a block, but also enable you to surround a change or an addition of code with a header and footer. Subsequently, a complementing feature of the add-in allows a developer to search a file or the whole project for changes made by programmer and date, thus producing a list of changes made by a programmer or all changes made on a certain date or time frame.

By now you should be able to see, if you are new to add-ins, the business case for writing add-ins.



 < Free Open Study > 



Writing Add-Ins for Visual Studio  .NET
Writing Add-Ins for Visual Studio .NET
ISBN: 1590590260
EAN: 2147483647
Year: 2002
Pages: 172
Authors: Les Smith

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net