Free Programming E-Books
Free download ebooks on computer and programming

Free .NET ebook "Best Kept Secrets in .NET" Sample Chapter

Best Kept Secrets in .NET
Free download Chapter 1: Hidden Treasures in Visual Studio
Download chapter

Author Deborah Kurata has spoken to .NET user groups all over America sharing her "Best Kept Secrets in .NET," and she often hears experienced developers say, "I didn't know you could do that with .NET!" This book is a collection of Deborah's insights into .NET secrets that can enhance your productivity and code quality.

For example, did you know that you could manage code snippets in Visual Studio .NET? Have you ever tried the Incremental Search feature? Have you discovered the ErrorProvider control? Do you know how to short-circuit operators, alias data types, build regular expressions, or improve your type casting? Have you seen all of the database tools available from Server Explorer? Did you know that you could manage your database scripts within Solution Explorer and include your stored procedures under source code control? Have you tried expanding the capabilities of a dataset using ExtendedProperties? With all of the talk about agile methodologies and Extreme Programming, have you tried to build a test harness with .NET? How about deprecating your methods? This book covers these secrets and much more!

Deborah also presents a collection of very valuable but lesser-known features of Visual Studio and the .NET Framework. She provides detailed information about how you can use each of these hidden treasures to improve the efficiency of your software development process and the quality of the resulting software. Whether you are an experienced developer or you're just getting started with .NET, this book will help you to be more productive, create better code, and produce superior software.

The primary goal of this book is to let you in on the secrets and hidden treasures that you can find discover in Visual Studio and the .NET Framework. If, as you read through this book, you say to yourself, "I didn't know I could do that with .NET!" then this book has met its objective.

< < prev next > >

Hidden Treasures in Visual Studio

When you have a great tool and learn the basics of using it, you get quite comfortable with it. Take your cell phone, for example. Once you learn the basics of how to make phone calls and store and retrieve phone numbers, your cell phone quickly becomes a part of your daily routine. But if you take a moment to read through the manual, you may find that your phone has many hidden treasures-many features that you didn't even know you had available.

The same is true with your Visual Studio interactive development environment (IDE). You know how to use Visual Studio to create projects, edit code, and build an executable. Since your focus is on getting the job done, you might not have time to explore the numerous features hiding in the many menus and dialog boxes. This chapter exposes these hidden treasures.

What Will This Chapter Cover?

This chapter uncovers the following Visual Studio secrets:

  • Laying out windows
  • Organizing code snippets
  • Managing your to-do list
  • Finding code
  • Using shortcut keys
  • Executing Visual Studio commands
  • Accessing external tools

By the end of this chapter, you will have discovered many of the hidden treasures in the Visual Studio IDE. You will be able to lay out your code windows for optimal access to the routines you are working on. You will see how to manage your code snippets so the code you need is always close at hand. You will learn how to use the Task List window to manage your development tasks. You will discover a dozen different ways to get to the code you need to find. You will see how easy it is to access the many features of Visual Studio using shortcut keys and Visual Studio commands, so there is no need for your hands to ever leave the keyboard. Finally, you will learn how to hook your favorite external tools directly into Visual Studio.

Organizing Code Snippets

You may often find that you write a little piece of code that you want to reuse again and again. These pieces of code are called code snippets. Wouldn't it be great to have a place to organize these snippets and easily find and use them when you need them? The Visual Studio Toolbox provides such a place.

Storing Code Snippets

Before you can use code snippets, you need to store them. Any bit of code that you want to reuse can be stored as a code snippet.

Store your snippets on the General tab of the Visual Studio Toolbox. (If your Toolbox is not displayed in the IDE, choose the View Toolbox option to display it.) Or, if you prefer to categorize your snippets, create additional tabs on the Visual Studio Toolbox by right-clicking a tab and selecting Add Tab from the context menu. Then store your snippets on your new tabs.

Add a code snippet to a tab of the Toolbox as follows:

  • Select the code snippet (or any text) in the code file.
  • Copy the text to the Clipboard.
  • Click the desired tab of the Toolbox.
  • Right-click the area below the tab.
  • Select Paste from the context menu.