ClassTextDocument
Represents a text document.
Definition
Namespace:Telerik.Windows.SyntaxEditor.Core.Text
Assembly:Telerik.Windows.SyntaxEditor.Core.dll
Syntax:
public class TextDocument
Inheritance: objectTextDocument
Constructors
TextDocument()
Initializes a new instance of the TextDocument class.
Declaration
public TextDocument()
TextDocument(TextDocument)
Initializes a new instance of the TextDocument class.
Declaration
public TextDocument(TextDocument document)
Parameters
document
TextDocument(TextReader)
Initializes a new instance of the TextDocument class.
Declaration
public TextDocument(TextReader textReader)
Parameters
textReader
TextDocument(string)
Initializes a new instance of the TextDocument class.
Properties
CurrentSnapshot
Gets the current snapshot.
Declaration
public TextSnapshot CurrentSnapshot { get; }
Property Value
History
Gets the document history.
Declaration
public TextDocumentHistory History { get; }
Property Value
Methods
Delete(Span)
Deletes the given span.
Find(string, int)
Looks up for a span containing the search text.
Find(string, int, bool)
Looks up for a span containing the search text.
Find(string, int, bool, bool)
Looks up for a span containing the search text or matching a regex pattern.
Find(string, int, bool, bool, bool)
Looks up for a span containing the search text or matching a regex pattern.
FindAll(string)
Looks up for a all spans containing the search text.
Declaration
public IEnumerable<Span> FindAll(string searchText)
Parameters
searchText
Returns
FindAll(string, bool)
Looks up for a all spans containing the search text or matching a regex pattern.
Declaration
public IEnumerable<Span> FindAll(string searchText, bool useRegularExpression)
Parameters
searchText
useRegularExpression
Returns
FindAll(string, bool, bool, bool)
Looks up for a all spans containing the search text or matching a regex pattern.
FindPrevious(string, int, bool)
Looks up for a previous span containing the search text or matching a regex pattern.
FindPrevious(string, int, bool, bool, bool)
Looks up for a previous span containing the search text or matching a regex pattern.
Insert(int, string)
Inserts text at the given position.
OnPreviewTextContentChanged(TextContentChangedEventArgs)
Raises the PreviewTextContentChanged event.
Declaration
protected virtual void OnPreviewTextContentChanged(TextContentChangedEventArgs args)
Parameters
args
OnPreviewTextContentChanging(TextContentChangingEventArgs)
Raises the PreviewTextContentChanging event.
Declaration
protected virtual void OnPreviewTextContentChanging(TextContentChangingEventArgs args)
Parameters
args
OnTextContentChanged(TextContentChangedEventArgs)
Raises the TextContentChanged event.
Declaration
protected virtual void OnTextContentChanged(TextContentChangedEventArgs args)
Parameters
args
OnTextContentChanging(TextContentChangingEventArgs)
Raises the TextContentChanging event.
Declaration
protected virtual void OnTextContentChanging(TextContentChangingEventArgs args)
Parameters
args
Replace(Span, string)
Replaces the given span with the given replace text.
ReplaceAllMatches(string, string, bool, bool, bool)
Replaces all matched strings of the given search text with the provided replace text.
ReplaceNextMatch(string, int, string, bool, bool)
Replaces the next matched strings of the given search text with the provided replace text.
Events
PreviewTextContentChanged
Occurs when text is about to be changed.
Declaration
public event EventHandler<TextContentChangedEventArgs> PreviewTextContentChanged
Event Value
PreviewTextContentChanging
Occurs when text is about to be changing.
Declaration
public event EventHandler<TextContentChangingEventArgs> PreviewTextContentChanging
Event Value
TextContentChanged
Occurs when text is changed.
Declaration
public event EventHandler<TextContentChangedEventArgs> TextContentChanged
Event Value
TextContentChanging
Occurs when text is changing.
Declaration
public event EventHandler<TextContentChangingEventArgs> TextContentChanging
Event Value