skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • NEW: Design Kits for Figma
    • Online Training
    • Document Processing Library
    • Embedded Reporting for web and desktop

    Web

    Kendo UI UI for jQuery UI for Angular UI for React UI for Vue UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI UI for Xamarin

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Test Studio Dev Edition Telerik JustMock

    CMS

    Sitefinity

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Support and Learning

    • Support and Learning Hub
    • First Steps
    • Docs
    • Demos
    • Virtual Classroom
    • Forums
    • Videos
    • Blogs
    • Accessibility and Security
    • Submit a Ticket

    Productivity and Design Tools

    • Visual Studio Extensions
    • Visual Studio Templates
    • Embedded Reporting
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class TextDocument

Represents a text document.

Inheritance
System.Object
TextDocument
Namespace: Telerik.Windows.SyntaxEditor.Core.Text
Assembly: Telerik.Windows.SyntaxEditor.Core.dll

Syntax

public class TextDocument : Object

Constructors

TextDocument()

Initializes a new instance of the TextDocument class.

Declaration
public TextDocument()

TextDocument(TextReader)

Initializes a new instance of the TextDocument class.

Declaration
public TextDocument(TextReader textReader)
Parameters
System.IO.TextReader textReader

TextDocument(String)

Initializes a new instance of the TextDocument class.

Declaration
public TextDocument(string text)
Parameters
System.String text

TextDocument(TextDocument)

Initializes a new instance of the TextDocument class.

Declaration
public TextDocument(TextDocument document)
Parameters
TextDocument document

Properties

CurrentSnapshot

Gets the current snapshot.

Declaration
public TextSnapshot CurrentSnapshot { get; }
Property Value
TextSnapshot

History

Gets the document history.

Declaration
public TextDocumentHistory History { get; }
Property Value
TextDocumentHistory

Methods

Delete(Span)

Deletes the given span.

Declaration
public bool Delete(Span spanToDelete)
Parameters
Span spanToDelete

Returns
System.Boolean

Find(String, Int32)

Looks up for a span containing the search text.

Declaration
public Nullable<Span> Find(string searchText, int startIndex)
Parameters
System.String searchText

System.Int32 startIndex

Returns
System.Nullable<Span>

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.String searchText

System.Int32 startIndex

System.Boolean useRegularExpression

Returns
System.Nullable<Span>

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.String searchText

System.Int32 startIndex

System.Boolean matchCase

System.Boolean useRegularExpression

Returns
System.Nullable<Span>

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.String searchText

System.Int32 startIndex

System.Boolean matchCase

System.Boolean useRegularExpression

System.Boolean matchWord

Returns
System.Nullable<Span>

FindAll(String)

Looks up for a all spans containing the search text.

Declaration
public IEnumerable<Span> FindAll(string searchText)
Parameters
System.String searchText

Returns
System.Collections.Generic.IEnumerable<Span>

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.String searchText

System.Boolean useRegularExpression

Returns
System.Collections.Generic.IEnumerable<Span>

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.String searchText

System.Boolean matchCase

System.Boolean useRegularExpression

System.Boolean matchWord

Returns
System.Collections.Generic.IEnumerable<Span>

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.String searchText

System.Int32 startIndex

System.Boolean matchCase

Returns
System.Nullable<Span>

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.String searchText

System.Int32 startIndex

System.Boolean matchCase

System.Boolean useRegularExpression

System.Boolean matchWord

Returns
System.Nullable<Span>

Insert(Int32, String)

Inserts text at the given position.

Declaration
public bool Insert(int position, string text)
Parameters
System.Int32 position

System.String text

Returns
System.Boolean

OnPreviewTextContentChanged(TextContentChangedEventArgs)

Raises the PreviewTextContentChanged event.

Declaration
protected virtual void OnPreviewTextContentChanged(TextContentChangedEventArgs args)
Parameters
TextContentChangedEventArgs args

OnPreviewTextContentChanging(TextContentChangingEventArgs)

Raises the PreviewTextContentChanging event.

Declaration
protected virtual void OnPreviewTextContentChanging(TextContentChangingEventArgs args)
Parameters
TextContentChangingEventArgs args

OnTextContentChanged(TextContentChangedEventArgs)

Raises the TextContentChanged event.

Declaration
protected virtual void OnTextContentChanged(TextContentChangedEventArgs args)
Parameters
TextContentChangedEventArgs args

OnTextContentChanging(TextContentChangingEventArgs)

Raises the TextContentChanging event.

Declaration
protected virtual void OnTextContentChanging(TextContentChangingEventArgs args)
Parameters
TextContentChangingEventArgs args

Replace(Span, String)

Replaces the given span with the given replace text.

Declaration
public bool Replace(Span spanToReplace, string replaceText)
Parameters
Span spanToReplace

System.String replaceText

Returns
System.Boolean

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.String searchText

System.String replaceText

System.Boolean matchCase

System.Boolean useRegularExpression

System.Boolean matchWord

Returns
System.Int32

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.String searchText

System.Int32 startIndex

System.String replaceText

System.Boolean matchCase

System.Boolean useRegularExpression

Returns
System.Boolean

Events

PreviewTextContentChanged

Occurs when text is about to be changed.

Declaration
public event EventHandler<TextContentChangedEventArgs> PreviewTextContentChanged
Event Type
System.EventHandler<TextContentChangedEventArgs>

PreviewTextContentChanging

Occurs when text is about to be changing.

Declaration
public event EventHandler<TextContentChangingEventArgs> PreviewTextContentChanging
Event Type
System.EventHandler<TextContentChangingEventArgs>

TextContentChanged

Occurs when text is changed.

Declaration
public event EventHandler<TextContentChangedEventArgs> TextContentChanged
Event Type
System.EventHandler<TextContentChangedEventArgs>

TextContentChanging

Occurs when text is changing.

Declaration
public event EventHandler<TextContentChangingEventArgs> TextContentChanging
Event Type
System.EventHandler<TextContentChangingEventArgs>

Extension Methods

CollectionExtensions.ToEnumerable<T>(T)
EnumerableExtensions.ToEnumerable<T>(T)
Getting Started
  • Install Now
  • Demos
  • SDK Samples Browser
  • Sample Applications
Support Resources
  • Code Library
  • Knowledge Base
  • MVVM Support
  • Videos
  • GitHub SDK Repository
Community
  • Forums
  • Blogs
  • XAML Feedback Portal
  • Document Processing Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.

OSZAR »