Class TextDocument
Represents a text document.
Inheritance
Namespace: Telerik.Windows.SyntaxEditor.Core.Text
Assembly: Telerik.Windows.SyntaxEditor.Core.dll
Syntax
public class TextDocument : Object
Constructors
TextDocument()
TextDocument(TextReader)
Initializes a new instance of the Text
Declaration
public TextDocument(TextReader textReader)
Parameters
System.
|
TextDocument(String)
Initializes a new instance of the Text
Declaration
public TextDocument(string text)
Parameters
System.
|
TextDocument(TextDocument)
Initializes a new instance of the Text
Declaration
public TextDocument(TextDocument document)
Parameters
Text
|
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.
Declaration
public bool Delete(Span spanToDelete)
Parameters
Span
spanToDelete
|
Returns
System.
|
Find(String, Int32)
Looks up for a span containing the search text.
Declaration
public Nullable<Span> Find(string searchText, int startIndex)
Parameters
System.
|
System.
|
Returns
System.
|
Find(String, Int32, Boolean)
Looks up for a span containing the search text.
Declaration
public Nullable<Span> Find(string searchText, int startIndex, bool useRegularExpression)
Parameters
System.
|
System.
|
System.
|
Returns
System.
|
Find(String, Int32, Boolean, Boolean)
Looks up for a span containing the search text or matching a regex pattern.
Declaration
public Nullable<Span> Find(string searchText, int startIndex, bool matchCase, bool useRegularExpression)
Parameters
System.
|
System.
|
System.
|
System.
|
Returns
System.
|
Find(String, Int32, Boolean, Boolean, Boolean)
Looks up for a span containing the search text or matching a regex pattern.
Declaration
public Nullable<Span> Find(string searchText, int startIndex, bool matchCase, bool useRegularExpression, bool matchWord)
Parameters
System.
|
System.
|
System.
|
System.
|
System.
|
Returns
System.
|
FindAll(String)
Looks up for a all spans containing the search text.
Declaration
public IEnumerable<Span> FindAll(string searchText)
Parameters
System.
|
Returns
System.
|
FindAll(String, Boolean)
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
System.
|
System.
|
Returns
System.
|
FindAll(String, Boolean, Boolean, Boolean)
Looks up for a all spans containing the search text or matching a regex pattern.
Declaration
public IEnumerable<Span> FindAll(string searchText, bool matchCase, bool useRegularExpression, bool matchWord = false)
Parameters
System.
|
System.
|
System.
|
System.
|
Returns
System.
|
FindPrevious(String, Int32, Boolean)
Looks up for a previous span containing the search text or matching a regex pattern.
Declaration
public Nullable<Span> FindPrevious(string searchText, int startIndex, bool matchCase)
Parameters
System.
|
System.
|
System.
|
Returns
System.
|
FindPrevious(String, Int32, Boolean, Boolean, Boolean)
Looks up for a previous span containing the search text or matching a regex pattern.
Declaration
public Nullable<Span> FindPrevious(string searchText, int startIndex, bool matchCase, bool useRegularExpression, bool matchWord)
Parameters
System.
|
System.
|
System.
|
System.
|
System.
|
Returns
System.
|
Insert(Int32, String)
Inserts text at the given position.
Declaration
public bool Insert(int position, string text)
Parameters
System.
|
System.
|
Returns
System.
|
OnPreviewTextContentChanged(TextContentChangedEventArgs)
Raises the PreviewTextContentChanged event.
Declaration
protected virtual void OnPreviewTextContentChanged(TextContentChangedEventArgs args)
Parameters
OnPreviewTextContentChanging(TextContentChangingEventArgs)
Raises the PreviewTextContentChanging event.
Declaration
protected virtual void OnPreviewTextContentChanging(TextContentChangingEventArgs args)
Parameters
OnTextContentChanged(TextContentChangedEventArgs)
Raises the TextContentChanged event.
Declaration
protected virtual void OnTextContentChanged(TextContentChangedEventArgs args)
Parameters
OnTextContentChanging(TextContentChangingEventArgs)
Raises the TextContentChanging event.
Declaration
protected virtual void OnTextContentChanging(TextContentChangingEventArgs args)
Parameters
Replace(Span, String)
Replaces the given span with the given replace text.
Declaration
public bool Replace(Span spanToReplace, string replaceText)
Parameters
Span
spanToReplace
|
System.
|
Returns
System.
|
ReplaceAllMatches(String, String, Boolean, Boolean, Boolean)
Replaces all matched strings of the given search text with the provided replace text.
Declaration
public int ReplaceAllMatches(string searchText, string replaceText, bool matchCase, bool useRegularExpression, bool matchWord = false)
Parameters
System.
|
System.
|
System.
|
System.
|
System.
|
Returns
System.
|
ReplaceNextMatch(String, Int32, String, Boolean, Boolean)
Replaces the next matched strings of the given search text with the provided replace text.
Declaration
public bool ReplaceNextMatch(string searchText, int startIndex, string replaceText, bool matchCase, bool useRegularExpression)
Parameters
System.
|
System.
|
System.
|
System.
|
System.
|
Returns
System.
|
Events
PreviewTextContentChanged
Occurs when text is about to be changed.
Declaration
public event EventHandler<TextContentChangedEventArgs> PreviewTextContentChanged
Event Type
System.
|
PreviewTextContentChanging
Occurs when text is about to be changing.
Declaration
public event EventHandler<TextContentChangingEventArgs> PreviewTextContentChanging
Event Type
System.
|
TextContentChanged
Occurs when text is changed.
Declaration
public event EventHandler<TextContentChangedEventArgs> TextContentChanged
Event Type
System.
|
TextContentChanging
Occurs when text is changing.
Declaration
public event EventHandler<TextContentChangingEventArgs> TextContentChanging
Event Type
System.
|