Skip Navigation LinksActipro Software / Products / .NET Controls / WPF / SyntaxEditor / Feature Tour

Editing and Appearance Features

Syntax Highlighting and Themes

SyntaxEditor is a syntax-highlighting code editor control that uses language definitions and a powerful text/parsing framework to provide many of the features found in the Visual Studio code editor. Highlighting styles can be completely customized by the end user, even allowing the changing of text area background and line number margin colors.

The SDI Editor demo, with SyntaxEditor using a custom theme

Advanced Editing Capabilities

SyntaxEditor has a number of display features you find in the Visual Studio code editor such as line numbers, visible whitespace, word wrap, line modification marks, split views, mouse wheel zooming, and more. Multiple undo/redo support is integrated with the editor. Selections can be made using the standard snaking mode or block (rectangular) mode.

Word wrap, line modification marks, block selection, and a scrollbar tray button

Over 100 Edit Actions

Over 100 edit actions are included with SyntaxEditor that cover everything from basic caret movement and selection to features such as tabification, character/word/line transposition, etc.

Unicode and Bi-Directional Editing Support

SyntaxEditor supports the editing of any Unicode characters and even has full support for working with embedded bi-directional text.

Code Outlining (Folding)

SyntaxEditor has complete support for code outlining, also known as code folding. Syntax languages can automatically choose where to create outlining nodes (based on tokens, AST's, etc.) or the end user can choose to create outlining nodes via selected text. When a node is collapsed, a customizable text adornment denotes where the collapsed node is. Hover the mouse over the adornment to see the collapsed node's text.

SyntaxEditor showing automatic code outlining of Javascript code, with the margin hover feature active

Certain nodes such as #region nodes can be marked to collapse by default, or marked so that they auto-collapse when Collapse to Definitions is used. The outlining margin renders the outlining node hierarchy and allows for easy toggling of outlining node expansion. Hover over expanded nodes in the outlining margin to see a highlight indicating the node's line range.

Adornments

A powerful adornment layer system allows for any sort of custom UI elements (images, shapes, and even controls) to be added anywhere within the text area. Animation is fully supported. Adornment layers can be set to appear before or after built-in layers, such as behind the selection, etc. Easily add squiggle lines, background highlights, or any other decoration to text.

Embed any sort of element, even popup buttons, directly in-line with text

A special kind of adornments called intra-text adornments embed themselves in-line with the text by reserving space and the text formatter adjusts the surrounding text to flow around the reserved space where the adornment appears.

Text/Parsing Framework Features

Documents and Snapshots

A document is what is "edited" by a SyntaxEditor, as it is the object that provides access to all the text being edited. It supports easy file load/save and can be tied to a language definition to provide extended functionality. The complete document text is available any time via snapshots, where each snapshot is an immutable versioned thread-safe copy of the text at the time it was created. Snapshots allow you to parse text without fear of it changing in the middle of a parse. There are powerful text scanning classes included and offsets within a snapshot can be translated to their relative location in any other snapshot for the same document. This means that you can reliably locate a certain range of text, even after multiple edits have been made.

Batch Text Change Operations

The text/parsing framework's text change model is extremely powerful and provides many helper methods for doing everything from simple text replace operations to append operations. Multiple operations can be queued up into a single text change and executed as a single atomic unit.

Language Definitions

Language definitions are a core piece of the text/parsing framework. They basically encapsulate all functionality for a particular code language that is being used within a SyntaxEditor control. This is everything from various types of parsing (which drive features like syntax highlighting) all the way to simpler features like determining word breaks or performing line commenting. Transitions between multiple languages are fully supported.

A HTML language definition that makes language transitions to other languages like CSS and JScript

Over 20 full source sample language definitions are included with SyntaxEditor for common languages like Assembly, Batch files, C#, CSS, HTML, INI files, Java, JScript, Lua, MSIL, Pascal, Perl, PHP, PowerShell, Python, SQL, VB.NET, VBScript, and XML. Custom language definition can easily be created, thereby making it possible to build a code editor for any proprietary language.

Line Commenting

Languages can each be assigned a line commenter that is capable of adding and removing comments. Algoritms for both line-based comments (like C#'s "//") and range comments (like XML's "<!-- -->) are supported. Custom algorithms can be developed as well.

Export to HTML and RTF

SyntaxEditor has built-in functionality for easily exporting syntax-highlighted text content to a string or file in HTML and/or RTF formats. Options are also available for auto-copying text in these formats when clipboard operations are performed.

IntelliPrompt Features

Completion List

The completion list popup is used to display a number of code completion options to the end user, not only providing intelligent information about the code being edited, but also improving the productivity of the end user by supporting "Ctrl+Space" functionality. Completion lists support a powerful filtering mechanism that can display tabs and/or buttons to show/hide items that meet certain criteria. They include numerous matching algorithm options, including some that allow you to make matches just by typing any characters in the item text. Custom matching algorithms can be developed, and the completion list auto-highlights matched text. Description tips show more information about items via the use of rich formatted content.

A completion list that has filtering UI, matched text highlighting, and a description tip displayed

Quick Info

Quick info tips can be used to give more information about what is at the current caret location or under the mouse. They support any type of content, however the most appealing way to add content is to use our mini-HTML markup language that applies rich formatting to the displayed text.

Printing Features

Dialogs and Options

The display of various Print and Print Preview dialogs is as easy as a simple method call. SyntaxEditor includes a number of settings that affect printouts only, and not the editor views.

Margins

Built-in margins include document title, line number, word wrap glyph, and page number margins. It's easy to create a custom margin and insert it anywhere in a printed page.

A custom printer view document title margin with a company logo, shown in the built-in print preview dialog

Searching (Find/Replace) Features

General Search Functionality

All of the standard find/replace options are available, such as match case, match whole word, search up, multiple search pattern providers (regular expressions, etc.), scope options, etc. Regular expression searches return captures and support substitutions.

Search Pattern Providers

Search pattern providers describe the format in which find and replace text can be entered when doing searches. SyntaxEditor includes normal, regular expression, wildcard, acronym, and shorthand providers but it's easy for you to build your own custom ones as well.

EditorSearchView Control

An EditorSearchView control is included that implements a complete find/replace user interface, similar to the one found in Visual Studio. It features stylish animations when making mode changes and showing/hiding options and can be embedded in a tool window from our Docking & MDI product.

The EditorSearchView control

Optional Add-ons

ANTLR Parser Integration

A free add-on is included with SyntaxEditor that allows it to integrate with DSL parsers created using the ANTLR parser generator. Create your DSL grammar using ANTLR (generally via ANTLRWorks), generate the ANTLR lexer/parser, and using our add-on, integrate it with SyntaxEditor in a few lines of code. The add-on is used to provide parsing and AST creation within SyntaxEditor.

Oslo Dataflow (MGrammar Parsers) Integration

A free add-on is included with SyntaxEditor that allows it to integrate with DSL parsers created using Microsoft's Olso MGrammar parser generator. Create your DSL (domain specific language) using MGrammar, generate a DynamicParser, and using our add-on, integrate it with SyntaxEditor in roughly 15 lines of code or less. The add-on is used to provide lexing, classification, syntax highlighting, parsing, AST creation, and parsing error reporting within SyntaxEditor.

Other Features

Performs Great with Large Documents

SyntaxEditor and the text/parsing framework have been specifically designed with large files in mind. They use numerous virtualization techniques that both reduce memory usage and improve performance, especially when large files are involved. SyntaxEditor can open a 10MB document almost instantly and its editing performance is unmatched by the competition.

Extensible Object Model and Separation of Document/UI

The SyntaxEditor product is split into two main assemblies: one that implements the text/parsing model and is cross platform (can be used in WinForms, ASP.NET, etc.) and one that implements the editor control user interface in WPF. There are a number of optional add-on assemblies that can be used and harness the frameworks in the main assemblies.

The object models in the product make extensive use of interfaces and thus, are extremely extensible. Our design provides for many extensibility points where you can customize the behavior of the editor however you need.

XBAP Support

SyntaxEditor fully supports use in XBAPs (browser applications). We have specifically engineered it to operate within the bounds of the XBAP security sandbox.

Extensive Documentation and Samples

Actipro has spent a lot of time refining the design of SyntaxEditor to take advantage of WPF best practices. We realize that a good product is only part of the equation though and have also worked very hard to write detailed documentation on the product. In addition to that, SyntaxEditor ships with the full source for many QuickStart examples that each focus on learning a specific feature.


Try a live online demo