Table of Contents

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

index SourceIndex

The catalogue's index.

copies ILibraryLocalCopies

The downloaded copies.

Returns

LibraryCatalogueCounts

Downloading(int, int, long)

"Downloading 2 of 5 · 4,3 MB left".

public static string Downloading(int current, int total, long bytesLeft)

Parameters

current int

The download in progress (1-based).

total int

The downloads under the node.

bytesLeft long

The bytes still to download.

Returns

string

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

index SourceIndex

The forecast source's index.

copies ILibraryLocalCopies

The downloaded copies.

now DateTimeOffset

The current time.

Returns

LibraryForecastCounts

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

source CollectionSource

The source.

Returns

string

KindOf(LibraryCollection)

A collection's kind tag: its sources' kind, or S-128 for the session collection.

public static string KindOf(LibraryCollection collection)

Parameters

collection LibraryCollection

The collection.

Returns

string

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

index SourceIndex

Returns

string

SourceLocation(CollectionSource)

Where the source is: its path or URL (a shared feed's token masked).

public static string SourceLocation(CollectionSource source)

Parameters

source CollectionSource

The source.

Returns

string

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

source LibrarySource

The source.

collection LibraryCollection

The collection it belongs to.

Returns

string

SourceUrl(CollectionSource)

The online source's URL, or null for a local source.

public static Uri? SourceUrl(CollectionSource source)

Parameters

source CollectionSource

The source.

Returns

Uri

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

input LibraryNodeStatusInput

What the node knows.

Returns

(string Line, LibraryNodeStatusKind Kind)