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
collectionsIReadOnlyList<LibraryCollection>itemIdstring
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>)
public static List<T>? Find<T>(IReadOnlyList<LibraryCollection> collections, LibraryItemQuery query, Func<CollectionItem, LibrarySource, T> create, Func<T, LibraryItemState> stateOf)
Parameters
collectionsIReadOnlyList<LibraryCollection>The library snapshot to search.
queryLibraryItemQueryThe filters.
createFunc<CollectionItem, LibrarySource, T>Creates the host's view of an item that passed the cheap filters.
stateOfFunc<T, LibraryItemState>The LibraryItemState behind a host view.
Returns
- List<T>
Type Parameters
TThe 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
collectionsIReadOnlyList<LibraryCollection>positionGeoPosition
Returns
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
collectionsIReadOnlyList<LibraryCollection>idGuid?