EditorSnapshotChangedEventArgs Class
Event arguments for the SyntaxEditor.DocumentTextChanged event.
public class EditorSnapshotChangedEventArgs : RoutedEventArgs
- Inheritance:
- Object EventArgs RoutedEventArgs Object
Constructors
EditorSnapshotChangedEventArgs(ITextSnapshot, ITextSnapshot, ITextChange)
Initializes a new instance of the EditorSnapshotChangedEventArgs
class.
public EditorSnapshotChangedEventArgs(ITextSnapshot oldSnapshot, ITextSnapshot newSnapshot, ITextChange textChange)
Parameter | Type | Description |
---|---|---|
oldSnapshot | ITextSnapshot | The ITextSnapshot that is in effect before the text change is applied. |
newSnapshot | ITextSnapshot | The ITextSnapshot that is in effect after the text change is applied. |
textChange | ITextChange | The ITextChange that is made. |
Properties
ChangedSnapshotRange
Gets a TextSnapshotRange that contains the unioned changed range relative to the NewSnapshot.
public TextSnapshotRange ChangedSnapshotRange { get; }
Property Value
- TextSnapshotRange:
A TextSnapshotRange that contains the unioned changed range relative to the NewSnapshot.
IsTypedWordStart
Gets whether the text change is a Typing
type that starts a word.
public bool IsTypedWordStart { get; }
Property Value
- Boolean:
true
if the text change is aTyping
type that starts a word; otherwise,false
.
NewSnapshot
Gets the ITextSnapshot that is in effect after the text change is applied.
public ITextSnapshot NewSnapshot { get; }
Property Value
- ITextSnapshot:
The ITextSnapshot that is in effect after the text change is applied.
Remarks
This property value may be null before the text change actually occurs.
OldSnapshot
Gets the ITextSnapshot that is in effect before the text change is applied.
public ITextSnapshot OldSnapshot { get; }
Property Value
- ITextSnapshot:
The ITextSnapshot that is in effect before the text change is applied.
TextChange
Gets the ITextChange that is made to the document, causing a transition from OldSnapshot to NewSnapshot.
public ITextChange TextChange { get; }
Property Value
- ITextChange:
The ITextChange that is made to the document.
TypedText
Gets the text that was typed, if the text change is a Typing
type, and didn't originate from an undo/redo.
public string TypedText { get; }
Property Value
- String:
The text that was typed if the above criteria is met; otherwise, null.
Remarks
This a helper property that is very useful for searching for things such as when a "." is typed so you know when to activate an IntelliPrompt completion list.
Methods
GetIsTypedWordStart(ITextSnapshot, ITextChange, CharClass)
Returns whether the specified text change is typing that starts a word.
public static bool GetIsTypedWordStart(ITextSnapshot snapshot, ITextChange textChange, CharClass wordStartChars)
Parameter | Type | Description |
---|---|---|
snapshot | ITextSnapshot | The new ITextSnapshot after the change. |
textChange | ITextChange | The ITextChange that caused the new snapshot. |
wordStartChars | CharClass | The characters that can start a word. |
Returns
- Boolean:
true
if the specified text change is typing that starts a word; otherwise,false
.