Table of Contents

Class DynamicFeatureRendererServiceCollectionExtensions

Namespace
EncDotNet.S100.Renderers.Mapsui.DynamicSources
Assembly
EncDotNet.S100.Renderers.Mapsui.dll

IServiceCollection helpers that correlate a IDynamicFeatureSource registration with an IDynamicFeatureRenderer registration under a shared string key.

public static class DynamicFeatureRendererServiceCollectionExtensions
Inheritance
DynamicFeatureRendererServiceCollectionExtensions
Inherited Members

Remarks

The viewer-side overlay host resolves the renderer for a registered source via IServiceProvider.GetKeyedService<IDynamicFeatureRenderer>( source.Metadata.RendererKey). Adapter authors typically call AddDynamicFeatureSource<TSource, TRenderer>(IServiceCollection, string, ServiceLifetime, ServiceLifetime) at composition time, which wires both registrations in one step and keeps the pair impossible to break in isolation.

When advanced lifetime / composition is required, register the renderer with AddDynamicFeatureRenderer<TRenderer>(IServiceCollection, string, ServiceLifetime) and the source separately via the standard IServiceCollection APIs.

Methods

AddDynamicFeatureRenderer<TRenderer>(IServiceCollection, string, ServiceLifetime)

Registers TRenderer as a keyed IDynamicFeatureRenderer under rendererKey.

public static IServiceCollection AddDynamicFeatureRenderer<TRenderer>(this IServiceCollection services, string rendererKey, ServiceLifetime lifetime = ServiceLifetime.Singleton) where TRenderer : class, IDynamicFeatureRenderer

Parameters

services IServiceCollection
rendererKey string
lifetime ServiceLifetime

Returns

IServiceCollection

Type Parameters

TRenderer

AddDynamicFeatureSource<TSource, TRenderer>(IServiceCollection, string, ServiceLifetime, ServiceLifetime)

Registers both TSource (as IDynamicFeatureSource) and TRenderer (as a keyed IDynamicFeatureRenderer) under rendererKey in a single call.

public static IServiceCollection AddDynamicFeatureSource<TSource, TRenderer>(this IServiceCollection services, string rendererKey, ServiceLifetime sourceLifetime = ServiceLifetime.Singleton, ServiceLifetime rendererLifetime = ServiceLifetime.Singleton) where TSource : class, IDynamicFeatureSource where TRenderer : class, IDynamicFeatureRenderer

Parameters

services IServiceCollection
rendererKey string
sourceLifetime ServiceLifetime
rendererLifetime ServiceLifetime

Returns

IServiceCollection

Type Parameters

TSource
TRenderer

Remarks

The source is registered with TryAddEnumerable(IServiceCollection, ServiceDescriptor) semantics so that multiple instances of the same source type may coexist without de-duplication, while keeping the renderer keyed registration unique to rendererKey.