Class LibrarySourceText
- Namespace
- EncDotNet.S100.Collections.Library
- Assembly
- EncDotNet.S100.Collections.dll
The words used when a Library source is being added (#792): titles, catalogue details, scope summaries and suggested names, shared by the viewer's Add-to-Library dialog and headless hosts.
public static class LibrarySourceText
- Inheritance
-
LibrarySourceText
- Inherited Members
Methods
CatalogUri(LibrarySourceKind, KnownCatalogueSource?)
The online catalogue being read: the known catalogue's, else the kind's default.
public static Uri CatalogUri(LibrarySourceKind kind, KnownCatalogueSource? known)
Parameters
kindLibrarySourceKindWhat is being added.
knownKnownCatalogueSourceThe known catalogue being added, if any.
Returns
CatalogueDetail(Uri, DateOnly?)
"host · catalogue dated 2026-09-17", or just the host until the catalogue is read.
public static string CatalogueDetail(Uri catalogUri, DateOnly? date)
Parameters
Returns
Cells(bool, int, long)
"N cells · X MB" (or the "all" form) for a cell selection.
public static string Cells(bool all, int count, long bytes)
Parameters
allboolTrue when the selection is the whole catalogue.
countintThe cells selected.
byteslongTheir download size.
Returns
DefaultName(string?)
The default collection name for a local path: its file or folder name (a manifest's without its suffix).
public static string DefaultName(string? path)
Parameters
pathstringThe path, or null.
Returns
EverythingCells(int, long)
"12,345 cells · 1.2 GB" for a whole catalogue.
public static string EverythingCells(int count, long bytes)
Parameters
Returns
FeedName(LibrarySourceKind, KnownCatalogueSource?)
The default collection name for an online catalogue (not a manifest), or null for a local source.
public static string? FeedName(LibrarySourceKind kind, KnownCatalogueSource? known)
Parameters
kindLibrarySourceKindWhat is being added.
knownKnownCatalogueSourceThe known catalogue being added, if any.
Returns
IsStale(DateOnly?, DateTimeOffset)
True when a catalogue is more than a year old (it may no longer be maintained).
public static bool IsStale(DateOnly? date, DateTimeOffset now)
Parameters
dateDateOnly?The date the catalogue declares.
nowDateTimeOffsetThe current time.
Returns
List(IReadOnlyList<string>)
"A, B, C", or "A, B and 3 more" past three.
public static string? List(IReadOnlyList<string> labels)
Parameters
labelsIReadOnlyList<string>The labels.
Returns
NothingDownloads(string)
The summary for a catalogue whose datasets are listed, not downloaded: "… · nothing is downloaded".
public static string NothingDownloads(string selectionSummary)
Parameters
selectionSummarystringWhat the selection amounts to.
Returns
ScopeSummary(bool, int, string)
The summary under the choices: what is included, a reminder that ticks are kept while everything is included, or a prompt to tick something.
public static string ScopeSummary(bool includeAll, int selectedCount, string selectionSummary)
Parameters
includeAllboolTrue when the whole catalogue is included.
selectedCountintHow many choices are ticked.
selectionSummarystringWhat the ticks (or, with none, the whole catalogue) amount to.
Returns
SuggestedName(string, bool, Func<string>)
The suggested name that follows the selection: "NOAA ENC — Alaska", or the base name for everything.
public static string SuggestedName(string baseName, bool unscoped, Func<string> describe)
Parameters
baseNamestringThe feed's name.
unscopedboolTrue when everything is included.
describeFunc<string>Describes the selection.
Returns
Title(LibrarySourceKind, KnownCatalogueSource?, bool)
The title of an add: the known catalogue's name, else the kind's.
public static string Title(LibrarySourceKind kind, KnownCatalogueSource? known, bool editingManifest = false)
Parameters
kindLibrarySourceKindWhat is being added.
knownKnownCatalogueSourceThe known catalogue being added, if any.
editingManifestboolTrue when a manifest source's groups are being chosen again.