Version

Events and Commands (xamSyntaxEditor)

Topic Overview

Purpose

This topic lists the events and supported commands available to you, while building your xamSyntaxEditor™ applications.

Required background

The following topics are prerequisites to understanding this topic:

Topic Purpose

In this topic, you will find information to help you better understand the xamSyntaxEditor’s functions.

This topic covers the text editing capabilities of the xamSyntaxEditor control from both the developer and user’s perspective.

Introduction

Introduction to the Events and Commands

This topic lists the available xamSyntaxEditor’s events and supported commands.

Note
Note

Look at the following two topics for more information about commands:

Events

Events summary chart

Event Groups Details

The x amSyntaxEditor is the main class providing text editing and syntax highlighting.

This is the abstract base class for the EditorDocumentView class.

Use this class to represent the editable areas of the xamSyntaxEditor (only one or two areas are supported).

This class represents the document and exposes methods for its manipulation.

XamSyntaxEditor Events

Overview

The following table lists the events available in the XamSyntaxEditor class.

Events

Event Description

Raised whenever the ActiveDocumentView changes.

Raised whenever the TextDocument assigned to the xamSyntaxEditor control changes.

Raised whenever the range or position of the selected text in the active view changes.

Raised whenever the number of views changes (for example adding or removing a split.).

Raised whenever a new DocumentViewBase loads because of a splitting.

Raised whenever a DocumentViewBase is removed because of removing a split.

DocumentViewBase Events

Overview

The following table lists the event available in the DocumentViewBase class.

Events

Event Description

Raised whenever the view’s set of visible lines changes in anyway. The argument supplied to this event exposes properties that let you enumerate through the lists of lines that were deleted, added or translated (i.e., moved) during the last layout pass. You will most likely add handlers for this event in your custom margins so that you can adjust your content appropriately, should modification occur to the set of visible lines.

EditorDocumentView Events

Overview

The following table lists the events available in the EditorDocumentView class.

Events

Event Description

Raised whenever the view becomes the active view (that is to say, when the view receives focus).

Raised whenever a view loses the focus to the other view in a split.

Raised when the range or position of selected text in the view changes.

TextDocument Events

Overview

The following table lists the events available in the TextDocument class.

Events

Event Details

Raised whenever a property has been changed on the TextDocument, for example - CurrentSnapshot, Syntaxtree etc.

Raised before applying any changes to the document. This event may be canceled if its CanCancel property returns true (which it does unless the source of the change is an undo or redo operation). It exposes before and after snapshots along with a list of the changes.

Raised after applying changes to the document. It exposes the before and after snapshots as well as the list of changes.

Raised whenever the Load or InitializeText methods are invoked. Changing the Language of a TextDocument that contains text will also raise this event.

Commands

Commands summary chart

Commands Details

All available Clipboard support commands

All available Undo / Redo commands.

All available Splitting commands.

Clipboard Commands

Overview

The following table lists the commands available for the clipboard support.

Commands

Command Details

Cut

Perform a Clipboard Cut operation.

Perform a Clipboard Copy operation.

Perform a Clipboard Paste operation.

Note
Note

More information about the Clipboard commands is available in the Clipboard Support topic.

[[Undo/_Redo]]

Undo / Redo Commands

Overview

The following table lists all of the available Undo / Redo commands.

Commands

Command Details

Perform an Undo operation.

Perform a Redo operation.

Note
Note

More information about the Undo / Redo commands is available in the Undo / Redo topic.

Splitting Commands

Overview

The following table lists the commands available for the xamSyntaxEditor’s Splitting support.

Commands

Command Details

Vertically splits the xamSyntaxEditor into two views.

Horizontally splits the xamSyntaxEditor into two views.

Removes the top or left view from the xamSyntaxEditor .

Only allows vertical splitting.

Only allows horizontal splitting.

Allow both horizontal and vertical splitting.

Disallow all splitting.

Note
Note

More information about the splitting commands is available in the Splitting topic.

Related Topics

The following topics provide additional information related to this topic.

Topic Purpose

This topic explains the supported clipboard operations provided by the xamSyntaxEditor control.

This topic will help you understand the document splitting capability of the xamSyntaxEditor and how to customize it.

This topic explains the xamSyntaxEditor control’s Undo and Redo operations.