Class DocumentContentRange
Provides document-order access to the section-owned main-story blocks.
Inherited Members
Namespace: DRIT.Document
Assembly: DRIT.Document.dll
Syntax
public sealed class DocumentContentRange
Properties
End
Gets the position immediately after the final section's content.
Declaration
public ContentPosition End { get; }
Property Value
| Type | Description |
|---|---|
| ContentPosition |
Length
Gets the aggregate text length.
Declaration
public int Length { get; }
Property Value
| Type | Description |
|---|---|
| int |
SpansParagraphBoundary
Gets a value indicating whether aggregate content contains a paragraph boundary.
Declaration
public bool SpansParagraphBoundary { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Start
Gets the first position in the aggregate document content.
Declaration
public ContentPosition Start { get; }
Property Value
| Type | Description |
|---|---|
| ContentPosition |
Text
Gets the aggregate document text in section order.
Declaration
public string Text { get; }
Property Value
| Type | Description |
|---|---|
| string |
Value
Gets the aggregate document text as a compatibility alias.
Declaration
public string Value { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
Delete()
Deletes the text in every section story while retaining its paragraph structure.
Declaration
public void Delete()
EnumerateBlocks()
Enumerates section-owned main-story blocks in document order without allocating a merged block collection.
Declaration
public IEnumerable<Node> EnumerateBlocks()
Returns
| Type | Description |
|---|---|
| IEnumerable<Node> | The ordered main-story blocks. |
Find(string)
Finds non-overlapping literal matches in document order.
Declaration
public IEnumerable<ContentRange> Find(string text)
Parameters
| Type | Name | Description |
|---|---|---|
| string | text | The text to find. |
Returns
| Type | Description |
|---|---|
| IEnumerable<ContentRange> | The matching story-local ranges. |
Find(string, FindReplaceOptions)
Finds literal matches using the specified find options.
Declaration
public IEnumerable<ContentRange> Find(string text, FindReplaceOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| string | text | The text to find. |
| FindReplaceOptions | options | The find options. |
Returns
| Type | Description |
|---|---|
| IEnumerable<ContentRange> | The matching story-local ranges. |
Find(string, StringComparison)
Finds non-overlapping literal matches using the specified comparison.
Declaration
public IEnumerable<ContentRange> Find(string text, StringComparison comparisonType)
Parameters
| Type | Name | Description |
|---|---|---|
| string | text | The text to find. |
| StringComparison | comparisonType | The string comparison mode. |
Returns
| Type | Description |
|---|---|
| IEnumerable<ContentRange> | The matching story-local ranges. |
Find(Regex)
Finds regular-expression matches using default find options.
Declaration
public IEnumerable<ContentRange> Find(Regex regex)
Parameters
| Type | Name | Description |
|---|---|---|
| Regex | regex | The regular expression to find. |
Returns
| Type | Description |
|---|---|
| IEnumerable<ContentRange> | The matching story-local ranges. |
Find(Regex, FindReplaceOptions)
Finds regular-expression matches using the specified find options.
Declaration
public IEnumerable<ContentRange> Find(Regex regex, FindReplaceOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| Regex | regex | The regular expression to find. |
| FindReplaceOptions | options | The find options. |
Returns
| Type | Description |
|---|---|
| IEnumerable<ContentRange> | The matching story-local ranges. |
Replace(string, string)
Replaces literal matches across all section stories.
Declaration
public int Replace(string oldValue, string newValue)
Parameters
| Type | Name | Description |
|---|---|---|
| string | oldValue | The text to replace. |
| string | newValue | The replacement text. |
Returns
| Type | Description |
|---|---|
| int | The number of replacements. |
Replace(string, string, FindReplaceOptions)
Replaces literal matches using the specified find and replace options.
Declaration
public int Replace(string oldValue, string newValue, FindReplaceOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| string | oldValue | The text to replace. |
| string | newValue | The replacement text. |
| FindReplaceOptions | options | The find and replace options. |
Returns
| Type | Description |
|---|---|
| int | The number of replacements. |
Replace(string, string, StringComparison)
Replaces literal matches using the specified comparison.
Declaration
public int Replace(string oldValue, string newValue, StringComparison comparisonType)
Parameters
| Type | Name | Description |
|---|---|---|
| string | oldValue | The text to replace. |
| string | newValue | The replacement text. |
| StringComparison | comparisonType | The string comparison mode. |
Returns
| Type | Description |
|---|---|
| int | The number of replacements. |
Replace(Regex, string)
Replaces regular-expression matches using default options.
Declaration
public int Replace(Regex regex, string replacement)
Parameters
| Type | Name | Description |
|---|---|---|
| Regex | regex | The regular expression to replace. |
| string | replacement | The replacement text. |
Returns
| Type | Description |
|---|---|
| int | The number of replacements. |
Replace(Regex, string, FindReplaceOptions)
Replaces regular-expression matches using the specified options.
Declaration
public int Replace(Regex regex, string replacement, FindReplaceOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| Regex | regex | The regular expression to replace. |
| string | replacement | The replacement text. |
| FindReplaceOptions | options | The find and replace options. |
Returns
| Type | Description |
|---|---|
| int | The number of replacements. |