The implicit line continuation feature in Visual Basic 2010 provided an opportunity to improve the code editing experience in XML literals embedded expressions. In Visual Studio 2008, pressing Enter inside an embedded expression would result in the cursor being positioned to the left of the end embedded expression tag. In Visual Studio 2010, pressing Enter inserts a newline for the cursor, and the end embedded expression tag moves to the line below. This minimizes the number of key strokes needed to nicely format an embedded expression.
Example 1: Pressing Enter in an empty embedded expression
1) Starting point:
2) Result after pressing Enter in Visual Studio 2008:
3) Result after pressing Enter in Visual Studio 2010:
Example 2: Pressing Enter at the end of a line in a LINQ query
1) Starting point:
2) Result after pressing Enter in Visual Studio 2008:
3) Result after pressing Enter in Visual Studio 2010:
This example also uses the new VB array literals feature in Visual Studio 2010 as the query source.
0 comments
Be the first to start the discussion.