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
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
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
ForecastEndedNote
For a forecast feed whose every run has ended, a note saying so; otherwise null.
public string? ForecastEndedNote { get; }
Property Value
Groups
The choice groups, once the catalogue has been read.
public IReadOnlyList<LibraryChoiceGroup> Groups { get; }
Property Value
IncludeAll
True to include the whole catalogue whatever is ticked (the default).
public bool IncludeAll { get; set; }
Property Value
IsCatalogueStale
True when the catalogue is more than a year old.
public bool IsCatalogueStale { get; }
Property Value
IsLoaded
True once the catalogue has been read (always false for a local path).
public bool IsLoaded { get; }
Property Value
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
KeepDownloadedHint
For a SECOM service, what keeping it downloaded means ("Downloads 9.8 MB now"); otherwise null.
public string? KeepDownloadedHint { get; }
Property Value
Kind
What is being added.
public LibrarySourceKind Kind { get; }
Property Value
Known
The known catalogue being added, or null for a local path.
public KnownCatalogueSource? Known { get; }
Property Value
Path
The local path being added, or null for an online catalogue.
public string? Path { get; }
Property Value
Scope
The part of the online catalogue included, or null for a local path.
public LibraryCatalogueScope? Scope { get; }
Property Value
ScopeSummary
What the ticks amount to, then whether they are kept, or a prompt to tick something.
public string ScopeSummary { get; }
Property Value
SelectedCount
How many choices are ticked.
public int SelectedCount { get; }
Property Value
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
Title
The title, as the viewer's dialog shows it.
public string Title { get; }
Property Value
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
libraryCollectionLibraryThe Library.
collectionIdGuid?An existing collection to add to, or null for a new one.
collectionNamestringThe 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
newCollectionNamestringThe new collection's name, when one is created: a manifest source takes it.
Returns
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
knownKnownCatalogueSourceThe catalogue.
readersLibraryCatalogueReadersReads catalogues.
timeTimeProviderThe clock (catalogue age); the system clock when null.
Returns
ForPath(LibrarySourceKind, string)
A draft for a local path.
public static LibrarySourceDraft ForPath(LibrarySourceKind kind, string path)
Parameters
kindLibrarySourceKindWhat the path is.
pathstringThe full path.
Returns
Exceptions
- ArgumentException
kindis an online kind.
LoadAsync(CancellationToken)
Reads the catalogue, for an online source.
public Task<string?> LoadAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenCancels the read.