Class WiredOrDiscoveredSettings
The two-tier rule every system's settings lookup follows: the reference a designer wired on the composition root wins, and label discovery is the fallback for a project that wired nothing.
Inherited Members
Namespace: Serenity.Global.Infrastructure.Utils
Assembly: Serenity.UnityGlobal.Infrastructure.dll
Syntax
public static class WiredOrDiscoveredSettings
Remarks
Extracted from UnityUiInstaller, which was the only installer implementing the rule by hand.
Neither method warns when nothing is found: what a missing settings asset means is the caller's
decision — some throw, some skip the subsystem, some fall back to defaults — so the caller keeps
its own message.
Methods
ResolveMany<T>(IReadOnlyList<T>, string, ILogService)
Resolves the settings assets a system with a collection of them installs from, through Resolve<T>(IReadOnlyList<T>, Func<IReadOnlyList<T>>): the pinned list is the whole set when the composition root pins anything, and label discovery answers only for an empty field. Discovery is not consulted at all for a pinned field — an author who pins a subset is excluding the rest on purpose.
Declaration
public static T[] ResolveMany<T>(IReadOnlyList<T> wired, string moduleLabel, ILogService logService) where T : Object, IFoundationSettings
Parameters
| Type | Name | Description |
|---|---|---|
| IReadOnlyList<T> | wired | The references the composition root carries, or null/empty when none are wired. |
| string | moduleLabel | The Addressables module label an empty field falls back to. |
| ILogService | logService | Where the resolution source is written, at verbose level. May be null. |
Returns
| Type | Description |
|---|---|
| T[] | The pinned assets when there is at least one, the discovered assets otherwise. |
Type Parameters
| Name | Description |
|---|---|
| T |
Resolve<T>(T, string, ILogService)
Resolves the single settings asset a system installs from.
Declaration
public static T Resolve<T>(T wired, string moduleLabel, ILogService logService) where T : Object, IFoundationSettings
Parameters
| Type | Name | Description |
|---|---|---|
| T | wired | The reference the composition root carries, or null when the field is empty. |
| string | moduleLabel | The Addressables module label discovery falls back to. |
| ILogService | logService | Where the resolution source is written, at verbose level. May be null. |
Returns
| Type | Description |
|---|---|
| T | The wired asset when there is one, the discovered asset otherwise, or null when neither exists. |
Type Parameters
| Name | Description |
|---|---|
| T |