Class MarkupText
An immutable snapshot of a markup document's text, with a version that grows by one with every change.
public sealed class MarkupText
- Inheritance
-
MarkupText
- Inherited Members
- Extension Methods
Constructors
MarkupText(string, int)
Initializes a new instance of the MarkupText class.
public MarkupText(string text, int version = 0)
Parameters
Exceptions
- ArgumentNullException
textis null.- ArgumentOutOfRangeException
versionis negative.
Properties
Text
Gets the markup text.
public string Text { get; }
Property Value
Version
Gets the snapshot's version.
public int Version { get; }
Property Value
Methods
Apply(TextChangeSet)
Applies changes and returns the next snapshot.
public MarkupText Apply(TextChangeSet changes)
Parameters
changesTextChangeSetThe changes, expressed against Text.
Returns
- MarkupText
A snapshot with the changed text and the next version.
Exceptions
- ArgumentNullException
changesis null.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.