# StorySourceText

Keeps exact source text together with optional dependency-free syntax spans. Tokenizers live in adapters and map their language-specific tokens into this model.

 Class  

`ChartForgeX.Stories`

**Namespace**

`ChartForgeX.Stories`

**Assembly**

`ChartForgeX.Stories`

**Source**

[StorySourceText.cs:105](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Stories/Stories/StorySourceText.cs#L105)

**Modifiers**

sealed

**Attributes**

 `Fluent` 

Keeps exact source text together with optional dependency-free syntax spans. Tokenizers live in adapters and map their language-specific tokens into this model.

## Inheritance

- object
- StorySourceText

## Usage

 Explore 14 API references to this type 

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 7

- Method [IStorySourceTokenizer.Tokenize](/api/chartforgex-stories-istorysourcetokenizer/#method-tokenize-string)
- Extension method [StorySourceText.Language](/api/chartforgex-stories-storysourcetext/#extension-language-chartforgex-stories-storysourcetext-string)
- Method [StorySourceText.AddSpan](/api/chartforgex-stories-storysourcetext/#method-addspan-int32-int32-chartforgex-stories-storysyntaxkind)
- Method [StorySourceText.Create](/api/chartforgex-stories-storysourcetext/#method-create-string-string)
- Method [StorySourceTextFluent.Language](/api/chartforgex-stories-storysourcetextfluent/#method-language-chartforgex-stories-storysourcetext-string)
- Property [StorySourceTimeline.Source](/api/chartforgex-stories-storysourcetimeline/#property-source)
- Property [VisualStorySourceSurface.Source](/api/chartforgex-stories-visualstorysourcesurface/#property-source)

### Accepted by parameters 7

- Extension method [StorySourceText.Language](/api/chartforgex-stories-storysourcetext/#extension-language-chartforgex-stories-storysourcetext-string) parameter `storySourceText`
- Method [StorySourceTextFluent.Language](/api/chartforgex-stories-storysourcetextfluent/#method-language-chartforgex-stories-storysourcetext-string) parameter `storySourceText`
- Method [StorySourceTimeline.Create](/api/chartforgex-stories-storysourcetimeline/#method-create-chartforgex-stories-storysourcetext) parameter `initial`
- Method [StorySourceTimeline.Edit](/api/chartforgex-stories-storysourcetimeline/#method-edit-int32-int32-chartforgex-stories-storysourcetext-timespan) parameter `insertion`
- Method [StorySourceTimeline.Paste](/api/chartforgex-stories-storysourcetimeline/#method-paste-chartforgex-stories-storysourcetext) parameter `source`
- Method [StorySourceTimeline.Type](/api/chartforgex-stories-storysourcetimeline/#method-type-chartforgex-stories-storysourcetext-timespan) parameter `source`
- Constructor [VisualStorySourceSurface.VisualStorySourceSurface](/api/chartforgex-stories-visualstorysourcesurface/#constructor-ctor-chartforgex-stories-storysourcetext-string-chartforgex-stories-visualstorysourceoptions) parameter `source`

 Filter members   

    Show inherited   

 

## Methods

 AddSpan 2 overloads 

 `public StorySourceText AddSpan(int start, int length, StorySyntaxKind kind)` [#](#method-addspan-int32-int32-chartforgex-stories-storysyntaxkind) 

[StorySourceText.cs:109](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Stories/Stories/StorySourceText.cs#L109)

Adds one ordered syntax span.

Parameters

**start int required**

**length int required**

**kind ChartForgeX.Stories.StorySyntaxKind required**

Returns

 `StorySourceText` 

 `public StorySourceText AddSpan(StorySourceSpan span)` [#](#method-addspan-chartforgex-stories-storysourcespan) 

[StorySourceText.cs:113](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Stories/Stories/StorySourceText.cs#L113)

Adds one ordered syntax span.

Parameters

**span ChartForgeX.Stories.StorySourceSpan required**

Returns

 `StorySourceText` 

 `public static StorySourceText Create(string text, string? language = null)` [#](#method-create-string-string) 

[StorySourceText.cs:105](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Stories/Stories/StorySourceText.cs#L105)

Creates source text without language-specific dependencies.

Parameters

**text string required**

**language string? = null optional**

Returns

 `StorySourceText` 

## Inherited Methods

 `public virtual bool Equals(object? obj)` [#](#method-equals-object) 

Inherited from object

Parameters

**obj object? required**

Returns

 `bool` 

 `public virtual int GetHashCode()` [#](#method-gethashcode) 

Inherited from object

Returns

 `int` 

 `public Type GetType()` [#](#method-gettype) 

Inherited from object

Returns

 `Type` 

 `public virtual string? ToString()` [#](#method-tostring) 

Inherited from object

Returns

 `string?` 

## Properties

 `public string Text { get; }` [#](#property-text) 

[StorySourceText.cs:92](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Stories/Stories/StorySourceText.cs#L92)

Gets the exact source text, including whitespace.

 `public string Language { get; set; }` [#](#property-language) 

[StorySourceText.cs:96](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Stories/Stories/StorySourceText.cs#L96)

Gets or sets the optional language identifier used by hosts and accessibility output. Blank values clear it; values are trimmed.

 `public IReadOnlyList<StorySourceSpan> Spans { get; }` [#](#property-spans) 

[StorySourceText.cs:101](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX.Stories/Stories/StorySourceText.cs#L101)

Gets ordered, non-overlapping syntax spans.

## Extension Methods

 `public static StorySourceText Language(StorySourceText storySourceText, string value)` [#](#extension-language-chartforgex-stories-storysourcetext-string) 

Sets [StorySourceText.Language](/api/chartforgex-stories-storysourcetext/): Gets or sets the optional language identifier used by hosts and accessibility output. Blank values clear it; values are trimmed.

Parameters

**storySourceText ChartForgeX.Stories.StorySourceText required**

The instance.

**value string required**

The value.

Returns

 `StorySourceText` The same instance. 

Examples

```csharp
// C# initializer or property        // C# fluent
storySourceText.Language = value;    storySourceText.Language(value);
```

<!-- PowerForge markdown artifact sha256:9E5E00F46BA96DC8815657722A3EA16103C501649587C56900F27665E0873652 -->
