SyntaxEditor - Read-Only Regions

by Avatar Bill Henning (Actipro)
Tuesday, January 27, 2015 at 2:10pm

PostBannerSyntaxEditorDevNotes

Feature Description

SyntaxEditor documents have always had the ability to be fully read-only and developers can also can cancel specific text change events for more fine-grained control. That being said, there are many cases where developers want to have an easy way to tell SyntaxEditor that a certain of text should not be editable by the end user.  That's where read-only regions come into play.

SyntaxEditorReadOnlyRegion

Read-only regions are implemented using our powerful tagging mechanism.  There is a new IReadOnlyRegionTag interface (with related ReadOnlyRegionTag implementation class) that can be used to mark read-only regions.  Getting going is as easy as tagging a text range using an instance of that class.

Best of all, the ReadOnlyRegionTag class also implements IClassificationTag, which associates the tag with a classification type for read-only text and gets styled with a silver background.  Of course this is fully customizable if you wish to have a different appearance, or no appearance difference at all.

When the end user attempts to edit anything that would cross within a read-only range, the text change will realize that it intersects a read-only range and will cancel.  The text range protected by the read-only region remains unchanged.

This is a very handy feature for certain scenarios and was highly requested by our customers.

Summary

The read-only region features described above were added in the latest v2014.2 maintenance releases of our WPF, Silverlight, and WinRT/XAML controls and are available for use.

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.