Table of Contents

Class LibrarySourceDraft

Namespace
EncDotNet.S100.Collections.Library
Assembly
EncDotNet.S100.Collections.dll

A Library source being added, for a host without the viewer's dialog (#792): what it is, the part of its catalogue it includes, the collection name it suggests, and the source it makes. Uses the same scopes and words as the viewer's Add-to-Library dialog.

public sealed class LibrarySourceDraft
Inheritance
LibrarySourceDraft
Inherited Members

Properties

CanBuild

True when the source can be built: its catalogue is read, or it has a path.

public bool CanBuild { get; }

Property Value

bool

CanKeepDownloaded

True when the source is online, so its items can be kept downloaded (#809; a SECOM service's sync, #807).

public bool CanKeepDownloaded { get; }

Property Value

bool

CatalogueDetail

"host ยท catalogue dated 2026-09-17" once an online catalogue is read; null before, or for a local source.

public string? CatalogueDetail { get; }

Property Value

string

ForecastEndedNote

For a forecast feed whose every run has ended, a note saying so; otherwise null.

public string? ForecastEndedNote { get; }

Property Value

string

Groups

The choice groups, once the catalogue has been read.

public IReadOnlyList<LibraryChoiceGroup> Groups { get; }

Property Value

IReadOnlyList<LibraryChoiceGroup>

IncludeAll

True to include the whole catalogue whatever is ticked (the default).

public bool IncludeAll { get; set; }

Property Value

bool

IsCatalogueStale

True when the catalogue is more than a year old.

public bool IsCatalogueStale { get; }

Property Value

bool

IsLoaded

True once the catalogue has been read (always false for a local path).

public bool IsLoaded { get; }

Property Value

bool

KeepDownloaded

True to keep the source's items downloaded and current on each refresh. Off by default, except for a SECOM service whose selection is small (Sync).

public bool KeepDownloaded { get; set; }

Property Value

bool

KeepDownloadedHint

For a SECOM service, what keeping it downloaded means ("Downloads 9.8 MB now"); otherwise null.

public string? KeepDownloadedHint { get; }

Property Value

string

Kind

What is being added.

public LibrarySourceKind Kind { get; }

Property Value

LibrarySourceKind

Known

The known catalogue being added, or null for a local path.

public KnownCatalogueSource? Known { get; }

Property Value

KnownCatalogueSource

Path

The local path being added, or null for an online catalogue.

public string? Path { get; }

Property Value

string

Scope

The part of the online catalogue included, or null for a local path.

public LibraryCatalogueScope? Scope { get; }

Property Value

LibraryCatalogueScope

ScopeSummary

What the ticks amount to, then whether they are kept, or a prompt to tick something.

public string ScopeSummary { get; }

Property Value

string

SelectedCount

How many choices are ticked.

public int SelectedCount { get; }

Property Value

int

ShowOnMap

Whether the source is shown on the map; null for the kind's default.

public bool? ShowOnMap { get; set; }

Property Value

bool?

SuggestedName

The collection name suggested: the catalogue's, following the selection, or the path's.

public string SuggestedName { get; }

Property Value

string

Title

The title, as the viewer's dialog shows it.

public string Title { get; }

Property Value

string

Methods

AddTo(CollectionLibrary, Guid?, string?)

Adds the source to library: to an existing collection, or a new one named collectionName.

public (Guid CollectionId, Guid SourceId) AddTo(CollectionLibrary library, Guid? collectionId = null, string? collectionName = null)

Parameters

library CollectionLibrary

The Library.

collectionId Guid?

An existing collection to add to, or null for a new one.

collectionName string

The new collection's name; SuggestedName when null.

Returns

(Guid CollectionId, Guid SourceId)

The collection and the new source.

Exceptions

InvalidOperationException

The draft cannot be built yet, or the collection does not exist.

Build(string?)

Builds the source the draft describes.

public CollectionSource Build(string? newCollectionName = null)

Parameters

newCollectionName string

The new collection's name, when one is created: a manifest source takes it.

Returns

CollectionSource

Exceptions

InvalidOperationException

The draft cannot be built yet (CanBuild is false).

ForCatalogue(KnownCatalogueSource, LibraryCatalogueReaders, TimeProvider?)

A draft for a known online catalogue, or null when its kind has no reader.

public static LibrarySourceDraft? ForCatalogue(KnownCatalogueSource known, LibraryCatalogueReaders readers, TimeProvider? time = null)

Parameters

known KnownCatalogueSource

The catalogue.

readers LibraryCatalogueReaders

Reads catalogues.

time TimeProvider

The clock (catalogue age); the system clock when null.

Returns

LibrarySourceDraft

ForPath(LibrarySourceKind, string)

A draft for a local path.

public static LibrarySourceDraft ForPath(LibrarySourceKind kind, string path)

Parameters

kind LibrarySourceKind

What the path is.

path string

The full path.

Returns

LibrarySourceDraft

Exceptions

ArgumentException

kind is an online kind.

LoadAsync(CancellationToken)

Reads the catalogue, for an online source.

public Task<string?> LoadAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Cancels the read.

Returns

Task<string>

Why the catalogue could not be read, or null.