Class S100ExchangeSet
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
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
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
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
sourceIAssetSourceThe 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.
cataloguePathstringThe catalogue's path relative to
source. The dataset paths the catalogue lists are resolved relative to the source root.cancellationTokenCancellationTokenCancels reading the catalogue.
Returns
- Task<S100ExchangeSet>
The opened exchange set.
Exceptions
- ArgumentNullException
sourceis null.- ArgumentException
cataloguePathis null or empty.- FileNotFoundException
sourcehas no file atcataloguePath(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
pathstringThe folder, catalogue file, or ZIP archive.
cancellationTokenCancellationTokenCancels 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
pathis null or empty.- FileNotFoundException
pathdoes not exist, or has noCATALOG.XMLwhere expected.- XmlException
The catalogue is not well-formed.