Table of Contents

Class S411PortrayalCatalogue

Namespace
EncDotNet.S100.Datasets.S411
Assembly
EncDotNet.S100.Datasets.S411.dll

S-411 portrayal catalogue. Extends GmlPortrayalCatalogueBase with an adapter XSLT for the mainRule, single-rule-only rule list, no multi-palette fallback, and fetch-rule resolver.

public sealed class S411PortrayalCatalogue : GmlPortrayalCatalogueBase, IVectorPortrayalCatalogue, IPortrayalCatalogue, IXsltRuleSource, ILuaRuleSource, IPortrayalAssetSource
Inheritance
S411PortrayalCatalogue
Implements
Inherited Members

Constructors

S411PortrayalCatalogue(PortrayalCatalogueProvider)

Creates an S-411 portrayal catalogue backed by the given provider.

public S411PortrayalCatalogue(PortrayalCatalogueProvider provider)

Parameters

provider PortrayalCatalogueProvider

The portrayal catalogue provider that supplies rule files and assets.

Exceptions

ArgumentNullException

provider is null.

Properties

Spec

The product specification (name + edition) this catalogue targets.

public override SpecRef Spec { get; }

Property Value

SpecRef

Methods

BuildRules()

Only the master mainRule top-level template is included; the per-class top-level templates are still loadable on demand via GetCompiledRuleAsync(string, CancellationToken).

protected override IReadOnlyList<PortrayalRule> BuildRules()

Returns

IReadOnlyList<PortrayalRule>

CreateXmlResolver(IReadOnlyDictionary<string, byte[]>)

Creates an XmlResolver used to resolve xsl:include/xsl:import URIs during XSLT compilation.

protected override XmlResolver CreateXmlResolver(IReadOnlyDictionary<string, byte[]> registeredBytes)

Parameters

registeredBytes IReadOnlyDictionary<string, byte[]>

Returns

XmlResolver

Remarks

The default implementation resolves filenames against the pre-fetched rule-file bytes dictionary. Override to add fallback resolution strategies (e.g. FetchRuleAsync(string, CancellationToken) for specs whose sub-templates are not registered as rule files).

GetCompiledRuleAsync(string, CancellationToken)

For the mainRule, substitutes the library's bundled adapter XSLT which produces the display-list dialect expected by this codebase's Part9DisplayListReader. All other rules delegate to base.

public override ValueTask<XslCompiledTransform> GetCompiledRuleAsync(string ruleName, CancellationToken cancellationToken = default)

Parameters

ruleName string
cancellationToken CancellationToken

Returns

ValueTask<XslCompiledTransform>

LoadPalettesAsync(Dictionary<PaletteType, ColorPalette>, CancellationToken)

S-411 1.2.1 PC ships no day/dusk/night colour profiles with multi-palette fallback; only load explicitly named palettes.

protected override Task LoadPalettesAsync(Dictionary<PaletteType, ColorPalette> palettes, CancellationToken cancellationToken)

Parameters

palettes Dictionary<PaletteType, ColorPalette>
cancellationToken CancellationToken

Returns

Task