Table of Contents

Class S100ExchangeSet

Namespace
EncDotNet.S100
Assembly
EncDotNet.S100.dll

An opened S-100 exchange set: its parsed CATALOG.XML and the datasets it lists, each of which opens as an S100Dataset parsed against the bundled catalogues. S-100 Part 17.

public sealed class S100ExchangeSet : IDisposable, IAsyncDisposable
Inheritance
S100ExchangeSet
Implements
Inherited Members
Extension Methods

Remarks

Datasets has one entry per dataset to load: an S-101 base cell and the sequential updates the set ships for it are grouped into a single entry, which opens with the updates applied. Every other dataset is its own entry.

Datasets opened from an exchange set read from its source lazily, so dispose them before (or together with) the exchange set.

Properties

Catalogue

The parsed exchange catalogue (CATALOG.XML).

public ExchangeCatalogue Catalogue { get; }

Property Value

ExchangeCatalogue

Datasets

The datasets to load, in catalogue order: one entry per dataset, except that an S-101 base cell and its in-set sequential updates share a single entry (see Updates).

public IReadOnlyList<S100ExchangeSetDataset> Datasets { get; }

Property Value

IReadOnlyList<S100ExchangeSetDataset>

Methods

Dispose()

Releases the source when this exchange set owns it (it was opened from a path); a borrowed source is left to its owner.

public void Dispose()

DisposeAsync()

Releases the source when this exchange set owns it (it was opened from a path); a borrowed source is left to its owner.

public ValueTask DisposeAsync()

Returns

ValueTask

OpenAsync(IAssetSource, string, CancellationToken)

Opens the exchange set whose catalogue is at cataloguePath inside source.

public static Task<S100ExchangeSet> OpenAsync(IAssetSource source, string cataloguePath = "CATALOG.XML", CancellationToken cancellationToken = default)

Parameters

source IAssetSource

The source holding the exchange set, e.g. a FileSystemAssetSource, a ZipAssetSource, or a CachingAssetSource over either. The exchange set borrows the source: the caller keeps ownership and must keep it alive for as long as the exchange set and any dataset opened from it are in use.

cataloguePath string

The catalogue's path relative to source. The dataset paths the catalogue lists are resolved relative to the source root.

cancellationToken CancellationToken

Cancels reading the catalogue.

Returns

Task<S100ExchangeSet>

The opened exchange set.

Exceptions

ArgumentNullException

source is null.

ArgumentException

cataloguePath is null or empty.

FileNotFoundException

source has no file at cataloguePath (the exact exception type is the source's).

XmlException

The catalogue is not well-formed.

OpenAsync(string, CancellationToken)

Opens the exchange set at path: a folder whose top level holds CATALOG.XML, the CATALOG.XML file itself, or a .zip archive whose root holds CATALOG.XML. A folder or archive that instead holds the S-100 Part 17 S100_ROOT folder is opened at S100_ROOT. Names are matched case-insensitively.

public static Task<S100ExchangeSet> OpenAsync(string path, CancellationToken cancellationToken = default)

Parameters

path string

The folder, catalogue file, or ZIP archive.

cancellationToken CancellationToken

Cancels reading the catalogue.

Returns

Task<S100ExchangeSet>

The opened exchange set. It owns the folder or archive source it creates, and releases it when disposed.

Exceptions

ArgumentException

path is null or empty.

FileNotFoundException

path does not exist, or has no CATALOG.XML where expected.

XmlException

The catalogue is not well-formed.