SyntaxEditor .NET Languages Add-on - VB Text Formatter

by Avatar Bill Henning (Actipro)
Wednesday, January 30, 2013 at 8:24pm

BlogPostBanner

Today I'd like to show off another new feature coming to the WPF and Silverlight .NET Languages Add-on:  Visual Basic text formatting!

As mentioned in our previous post, a similar feature is being added for the C# language.  Text formatters beautify code, making it more readable by adjusting whitespace.

Visual Basic Text Formatting Example

Let's see an example of some messy VB code loaded up in SyntaxEditor:

VB1

After formatting the document, the result is:

VB2

That's much nicer!

Intelligent Modifications

As described in a previous post, the best part about the text formatting feature is that SyntaxEditor only adjusts ranges it needs to.  It doesn't do a mass replace of the whole document.  For instance on line 23, it tweaks the leading whitespace on the line and removes the space before the end parenthesis, but doesn't touch the rest of the line.

All of the various text change operations involved in the formatting are merged into a single atomic text change that is added as a single undo stack item.  This makes it easy for the end user to quickly undo any formatting changes that were made.

Summary

These features will be in the 2013.1 versions of the WPF and Silverlight SyntaxEditor .NET Languages Add-on.

TaskDownload TaskLiveDemo TaskBuyNow

Actipro's WPF Controls

Over 100 UI controls for building beautiful Windows Presentation Foundation desktop apps.

Learn More

Over 100 UI controls for building beautiful Windows Presentation Foundation desktop apps.

Includes editors, docking windows, MDI, property grids, charts, tree controls, ribbons, gauges, themes, and much more.

Learn More Download Free Trial

Add Comment

Please log in to a validated account to post comments.