Class LibraryNodeText
- Namespace
- EncDotNet.S100.Collections.Library
- Assembly
- EncDotNet.S100.Collections.dll
The names, kind tags and status lines of Library collections and sources, in the words the viewer's Library panel uses, for every host (#792).
public static class LibraryNodeText
- Inheritance
-
LibraryNodeText
- Inherited Members
Methods
CatalogueCounts(SourceIndex, ILibraryLocalCopies)
A remote S-100 catalogue's local and update counts, from the copies on disk.
public static LibraryCatalogueCounts CatalogueCounts(SourceIndex index, ILibraryLocalCopies copies)
Parameters
indexSourceIndexThe catalogue's index.
copiesILibraryLocalCopiesThe downloaded copies.
Returns
Downloading(int, int, long)
"Downloading 2 of 5 · 4,3 MB left".
public static string Downloading(int current, int total, long bytesLeft)
Parameters
currentintThe download in progress (1-based).
totalintThe downloads under the node.
bytesLeftlongThe bytes still to download.
Returns
ForecastCounts(SourceIndex, ILibraryLocalCopies, DateTimeOffset)
Per model of a forecast source: whether a run is on disk, whether a newer run is listed, whether the downloaded run has ended, and the least time left among the downloaded runs.
public static LibraryForecastCounts ForecastCounts(SourceIndex index, ILibraryLocalCopies copies, DateTimeOffset now)
Parameters
indexSourceIndexThe forecast source's index.
copiesILibraryLocalCopiesThe downloaded copies.
nowDateTimeOffsetThe current time.
Returns
KindOf(CollectionSource)
A short mono tag naming the kind of source: DIR, ZIP,
WEB (an online catalogue), AWS (a catalogue on AWS Open
Data), LIST (a community list), FEED (a shared feed),
SECOM, JSON (a collection manifest) or S-128.
public static string KindOf(CollectionSource source)
Parameters
sourceCollectionSourceThe source.
Returns
KindOf(LibraryCollection)
A collection's kind tag: its sources' kind, or S-128 for the session collection.
public static string KindOf(LibraryCollection collection)
Parameters
collectionLibraryCollectionThe collection.
Returns
SecomCode(SourceIndex)
The SecomDiagnosticCodes code of a SECOM source's last read, when it could not read the service for a certificate reason (#880); otherwise null.
public static string? SecomCode(SourceIndex index)
Parameters
indexSourceIndex
Returns
SourceLocation(CollectionSource)
Where the source is: its path or URL (a shared feed's token masked).
public static string SourceLocation(CollectionSource source)
Parameters
sourceCollectionSourceThe source.
Returns
SourceName(LibrarySource, LibraryCollection)
The source's name: the user's (or the dialog's) display name, unless it only repeats something generic — a legacy "All …" name, the collection's name or the catalogue's — in which case it is derived: a community list holding a single package is named by that package's description.
public static string SourceName(LibrarySource source, LibraryCollection collection)
Parameters
sourceLibrarySourceThe source.
collectionLibraryCollectionThe collection it belongs to.
Returns
SourceUrl(CollectionSource)
The online source's URL, or null for a local source.
public static Uri? SourceUrl(CollectionSource source)
Parameters
sourceCollectionSourceThe source.
Returns
Status(LibraryNodeStatusInput)
A second line for a node, only when something is off-normal: indexing, downloading, problems, a shared feed's reachability, a catalogue's or forecast's bookkeeping, a sync, or the session's hint. A null line keeps the node to one line.
public static (string? Line, LibraryNodeStatusKind Kind) Status(LibraryNodeStatusInput input)
Parameters
inputLibraryNodeStatusInputWhat the node knows.