Click or drag to resize
ContentRange Class
Represents a contiguous area in a document between two ContentPositions.
Inheritance Hierarchy
SystemObject
  GemBox.DocumentContentRange

Namespace:  GemBox.Document
Assembly:  GemBox.Document (in GemBox.Document.dll) Version: 25.3.30.1255
Syntax
public sealed class ContentRange

The ContentRange type exposes the following members.

Constructors
  NameDescription
Public methodContentRange
Initializes a new instance of the ContentRange class.
Top
Properties
  NameDescription
Public propertyEnd
Gets the ContentPosition that marks the end of the current ContentRange.
Public propertyFormFieldsData
Gets the snapshot of form fields data for all form fields in the current range.
Public propertyStart
Gets the ContentPosition that marks the beginning of the current ContentRange.
Top
Methods
  NameDescription
Public methodDelete
Deletes the document content specified with the current ContentRange.
Public methodFind(String)
Finds all ContentRanges which contain the specified text.
Public methodFind(Regex)
Finds all ContentRanges which match the specified Regex.
Public methodLoadText(String)
Loads the specified text to the current ContentRange.
Public methodLoadText(String, CharacterFormat)
Loads the specified text with specific formatting to the current ContentRange.
Public methodLoadText(String, HtmlLoadOptions)
Loads the specified HTML text to the current ContentRange.
Public methodLoadText(String, RtfLoadOptions)
Loads the specified RTF text to the current ContentRange.
Public methodLoadText(String, TxtLoadOptions)
Loads the specified text to the current ContentRange.
Public methodReplace(String, String)
Replaces all occurrences of the specified text with another text in the current ContentRange.
Public methodReplace(Regex, String)
Replaces all matches of the specified Regex with specified text in the current ContentRange.
Public methodSaveToClipboard(SaveOptions)
Saves the current ContentRange to the clipboard using specified text formats.
Public methodSaveToClipboard(IEnumerableSaveOptions)
Saves the current ContentRange to the clipboard using specified text formats.
Public methodSet
Sets the content of the current ContentRange to a content specified with the range parameter.
Public methodToString
Returns a plain text that represents this ContentRange instance.
(Overrides ObjectToString.)
Top
Remarks

ContentRange is defined by a starting and ending ContentPosition.

Similar to the way Bookmarks are used in a document, ContentRange instances are used to identify specific portions of a document. However, unlike a Bookmark, a ContentRange instance only exists while the programming code that defined it is running.

ContentPosition enables to view the document as a contiguous sequence of characters by hiding the complexity of the underlying hierarchical content model.

ContentRange offers following functionalities:

ContentRange is exposed on following members:

For more information, see content manipulation samples.

See Also