StringTextSource
public class StringTextSource : ITextStudioTextSourceMutable in-memory text source that tracks replacements and append operations for incremental compilation.
Constructors
Section titled “Constructors”
StringTextSource(string)
Section titled “StringTextSource(string)”public StringTextSource(string text = "")Creates a source with optional initial markup.
Parameters
| Name | Type | Description |
|---|---|---|
text |
System.String | Initial markup. A null value is treated as empty when first processed. |
Methods
Section titled “Methods”
GetCanonicalText()
Section titled “GetCanonicalText()”public string GetCanonicalText()Gets the complete canonical markup represented by the source.
Returns
System.String: Current markup. Implementations should return an empty string instead of null.
GetVersion()
Section titled “GetVersion()”public uint GetVersion()Gets a monotonically changing value used to detect source mutations without comparing text.
Returns
System.UInt32
SetText(string)
Section titled “SetText(string)”public void SetText(string text)Replaces canonical markup and notifies listeners when its value changes.
Parameters
| Name | Type | Description |
|---|---|---|
text |
System.String | Replacement markup. |
AppendText(string)
Section titled “AppendText(string)”public void AppendText(string markup)Append markup to the current text without treating it as a fresh replacement. Bumps the version so downstream stages rebuild, but callers that want to preserve reveal/animation state for the already-shown prefix can key off text length diffs.
Parameters
| Name | Type |
|---|---|
markup |
System.String |
Events
Section titled “Events”
Changed
Section titled “Changed”public event Action ChangedOccurs after canonical text or its effective interpretation changes.
Returns
System.Action