Table of Contents

Class LibraryQuery

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

Finds library items (issue #655): the filters behind the Library panel's map taps and the MCP query_library_items tool.

public static class LibraryQuery
Inheritance
LibraryQuery
Inherited Members

Methods

FindById(IReadOnlyList<LibraryCollection>, string)

Finds an item by its id (Id).

public static (CollectionItem Item, LibrarySource Source)? FindById(IReadOnlyList<LibraryCollection> collections, string itemId)

Parameters

collections IReadOnlyList<LibraryCollection>
itemId string

Returns

(CollectionItem Item, LibrarySource Source)?

The item and its source, or null when no item has that id.

Find<T>(IReadOnlyList<LibraryCollection>, LibraryItemQuery, Func<CollectionItem, LibrarySource, T>, Func<T, LibraryItemState>)

Every item matching query, or null when its SourceId names no collection or source.

public static List<T>? Find<T>(IReadOnlyList<LibraryCollection> collections, LibraryItemQuery query, Func<CollectionItem, LibrarySource, T> create, Func<T, LibraryItemState> stateOf)

Parameters

collections IReadOnlyList<LibraryCollection>

The library snapshot to search.

query LibraryItemQuery

The filters.

create Func<CollectionItem, LibrarySource, T>

Creates the host's view of an item that passed the cheap filters.

stateOf Func<T, LibraryItemState>

The LibraryItemState behind a host view.

Returns

List<T>

Type Parameters

T

The host's view of an item (a row view model, or LibraryItemState itself).

Remarks

Spec and bounds filter the raw items first; only the survivors get a state, since resolving one checks the file system and session.

HitsAt(IReadOnlyList<LibraryCollection>, GeoPosition)

Every item covering position, most detailed (highest usage band, then smallest extent) first.

public static IEnumerable<(CollectionItem Item, LibrarySource Source)> HitsAt(IReadOnlyList<LibraryCollection> collections, GeoPosition position)

Parameters

collections IReadOnlyList<LibraryCollection>
position GeoPosition

Returns

IEnumerable<(CollectionItem Item, LibrarySource Source)>

ScopeOf(IReadOnlyList<LibraryCollection>, Guid?)

The source ids id names: every source when it is null, a collection's sources, or one source; null when it names nothing.

public static IReadOnlySet<Guid>? ScopeOf(IReadOnlyList<LibraryCollection> collections, Guid? id)

Parameters

collections IReadOnlyList<LibraryCollection>
id Guid?

Returns

IReadOnlySet<Guid>