Toolbox

Save Coding Time, Manage Compressed Files, and More

Scott Mitchell

Contents

Save Coding Time
Manage Compressed Files
Inspect HTTP Traffic
The Bookshelf

Save Coding Time

While Visual Studio offers an abundance of built-in productivity tools, a number of third-party products can further increase your proficiency. CodeSMART G2 for Visual Studio by AxTools offers dozens of windows, tools, wizards, and dialogs that can dramatically reduce time spent on repetitive coding tasks.

CodeSMART adds several Explorer windows to Visual Studio®, all of which can be docked, pinned, or floated like any other Visual Studio window. The Code Explorer window combines the best aspects of the Visual Studio Solution Explorer and Class View windows, allowing you to view the files in your project and drill down into the classes and members comprising each file. Furthermore, each method in the Code Explorer includes a Code Flow folder that lists (and nests) the method's conditional statements and control flow constructs. Double-clicking any node in the Code Explorer whisks you to the appropriate location and adds the entry to the History pane for quick access.

CodeSMART Adds Explorer Windows

CodeSMART Adds Explorer Windows(Click the image for a larger view)

On the design side, CodeSMART's Designer Explorer lists the controls in the currently opened design window, along with the properties of the selected control. When adding a new control to the designer, CodeSmith can be configured to automatically pop up a dialog to set the Text and Name properties.

The Explorer windows and design-time dialogs are great time savers, but CodeSMART really shines with its AutoText and SmartComplete features. Much like Microsoft® Word can auto-complete a word or common phrases from the first few letters, the AutoText feature maps short, simple key combinations into lengthy, often-used code blocks. For example, just type "tc", then space, and-voilà-a complete try...catch block appears with the cursor positioned inside the try. SmartComplete is similar to IntelliSense®, showing language keywords, statements, and so on, but can be customized to include user-defined items. For Visual Studio 2005 users, AutoText and SmartComplete are like Code Snippets; however, AutoText and SmartComplete's rules are easier to create and modify.

CodeSMART offers other code building dialogs, assorted code formatting and documentation tools, and program statistics reports. If you spend too much time writing repetitive code, CodeSMART can help you spend less.

Price: $189 per single-user license.

www.axtools.com

Manage Compressed Files

The ZIP file format has been a popular compression format since its introduction in 1989, offering an easy way to archive and compress files. There are a number of third-party .NET Framework-based components available for working with ZIP files, including ZipForge.NET version 1.0 by ComponentAce.

ZipForge.NET provides a straightforward API for creating, encrypting, searching, and extracting ZIP files. With just four lines of code, you can create a new ZIP file, populating it with files or content from a byte array or stream. Extracting the archive's contents can be accomplished just as easily.

The ZipForge.NET API includes a number of Find methods useful for searching the contents of an archive. These Find methods can be used to enumerate the entire contents of a ZIP file, or to work with only a subset of the files (such as all JPG files).

Performing more complex ZIP-related functions is just as easy. Need to password-protect an archive? Just set the Password property. When working with large archives, event handlers for the OnFileProgress and OnOverallProgress events can be used to monitor the progress of the operation.

Price: Free for the Personal Edition; 149 Euros (around $125) for the single developer, royalty -free Commercial Edition with source code.

www.componentace.com

Inspect HTTP Traffic

Debugging Web applications is often a difficult process due to the logical, physical, and temporal separations among the server- and client-side technologies. Bugs can arise from any of the server-side tiers- the backend database, the application tier, the code in the dynamic Web pages-or can be due to the HTML and JavaScript sent to the browser, or in the serialization or transfer of data between any of these different layers.

In the past, virtually all bugs sprang from an error in code on the server. Today, however, Web pages are becoming increasingly complex, carrying dozens of inline and external stylesheet and script definitions.

HttpWatch Records Traffic

HttpWatch Records Traffic(Click the image for a larger view)

When hunting down a bug in a Web application, it helps to start from the client and inspect what markup and script has been received. It's also important to look at what data is being sent back to the server. While you can always use View|Source to examine the received markup, a tool like HttpWatch 4.x from Simtec Limited greatly simplifies and hastens the process.

Once installed, HttpWatch can be launched directly from Microsoft® Internet Explorer® through a toolbar icon. When it is activated, HttpWatch records all HTTP traffic, providing both the raw data and a variety of summary reports for your perusal.

It is amazing how many HTTP requests occur when visiting a typical Web page. There's the request for the Web page itself, of course, plus requests for the images on the page, and requests for external cascading style sheets and script resources as well. In short, the amount of data can be overwhelming. To combat this, HttpWatch provides filters that can be used to limit or highlight the results by content type, URL, HTTP status code, HTTP headers, and so on.

Along with the raw HTTP traffic, HttpWatch also provides numerous summary tabs that show a selected request's headers, cookies, querystring, POST data, and so on. In addition, many of these summary reports can be searched or exported.

Price: $249 per single-user license.

www.httpwatch.com

The Bookshelf

For developers programming against large, high-level frameworks, mastery of the development environment is increasingly essential. Like many .NET developers, I spend hours inside of Visual Studio each and every day. The more I learn about Visual Studio options, shortcuts, windows, toolbars, and features, the more productive I become and the less time I spend fighting with the IDE.

One book I've found particularly helpful in demystifying the Visual Studio environment is Microsoft Visual Studio 2005 Unleashed (Sams, 2006). In this 870-page tome, Lars Powers and Mike Snell meticulously explore the multitude of menus, configuration settings, project types, and features that comprise Visual Studio 2005.

The book is divided into four parts. The first part provides a quick tour of Visual Studio, while the second part delves into the environment in much greater detail. Part 2 includes chapters on productivity aids such as change tracking, code outlining, smart tags and smart tasks, IntelliSense, and the task list. Other chapters explore myriad debugging options, working with the Visual Studio automation object model, and writing macros, add-ins, and wizards.

Part 3 shows how to accomplish various tasks in Visual Studio. These chapters are useful if you need to discover how to perform a very specific task, such as adding a stored procedure to a database project or creating a custom control for a Windows® Forms application. The text doesn't include any discussion on programming practices or explanations of the code-it just shows you how to complete the task using Visual Studio.

The final part looks at Visual Studio 2005 Team System, exploring common tasks such as using source control, work item tracking, modeling, testing, and so on. If you don't use Visual Studio 2005 Team System, don't discount this book, as there's still a wealth of information in the middle two parts that make it a worthwhile resource.

If you spend countless hours of your day in Visual Studio, consider picking up a copy of Microsoft Visual Studio 2005 Unleashed. It will likely become a permanent fixture on your desk and your first stop for finding answers to your Visual Studio questions.

Price: $59.99.

www.samspublishing.com

Send your questions and comments for Scott to  toolsmm@microsoft.com.

Scott Mitchell, author of numerous books and founder of 4GuysFromRolla.com, is an MVP who has been working with Microsoft Web technologies since 1998. Scott is an independent consultant, trainer, and writer. Reach him at Mitchell@4guysfrom­rolla.com or via his blog at ScottOnWriting.NET.

All prices were confirmed at press time and are subject to change. The opinions expressed in this column are solely those of the author and do not necessarily reflect the opinions of Microsoft.

MSDN Magazine does not make any representation or warranty, express or implied with respect to any code or other information herein. MSDN Magazine disclaims any liability whatsoever for any use of such code or other information.