Nice VS 2008 Code Editing Improvements
page 5 of 7
by Scott Guthrie
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 23905/ 69

Organize C# Using Statements

The C# editor has added some great intellisense improvements as well.  Some of the biggest obviously include language intellisense and refactoring support for the new language features (Lambdas, Extension Methods, Query Syntax, Anonymous Types, etc).  Just like in our VB example above, C# supports type inference and intellisense completion of anonymous types:

Figure 14

One of the small, but nice, new features I recently noticed in VS 2008 is support for better organizing using statements in C#.  You can now select a list of using statements, right-click, and then pull up the "Organize Usings" sub-menu:

Figure 15

You can use this to alphabetically sort your namespaces (one of my pet peeves), and optionally use the 'Remove Unused Usings" command to remove un-necessary namespace declarations from the file:

Figure 16

When you use this command the editor will analyze what types you are using in your code file, and automatically remove those namespaces that are declared but not needed to support them.  A small but handy little feature.

View Entire Article

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2023  |  Page Processed at 2023-12-02 8:04:18 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search