Class SingletonSettingsSelection
The ownership rule every singleton settings lookup applies, both at runtime
(UnitySingletonSettingsLoader) and in editor validation
(SerenitySystemConfigurationResolver): a project-owned settings asset beats a
shipped one with the same Id. Engine-agnostic and Unity-free — the caller decides what
"project-owned" and "Id" mean for its own candidate type.
Not the rule a COLLECTION lookup applies. This one asks "which candidate is authoritative for one
slot" and answers by OWNERSHIP; CollectionSettingsSelection asks "is this asset the one
another was cloned from" and answers by ID PAIRING, without consulting ownership at all. Two
questions, two rules — do not merge them.
Inherited Members
Namespace: Serenity.Shared.Utils
Assembly: Serenity.Shared.dll
Syntax
public static class SingletonSettingsSelection
Methods
Pick<T>(IReadOnlyList<T>, Func<T, bool>, Func<T, string>, out SingletonSelectionOutcome)
Picks the single candidate a singleton settings lookup should use.
Declaration
public static T Pick<T>(IReadOnlyList<T> candidates, Func<T, bool> isProjectOwned, Func<T, string> idOf, out SingletonSelectionOutcome outcome)
Parameters
| Type | Name | Description |
|---|---|---|
| IReadOnlyList<T> | candidates | Every candidate found for the settings type, in any order. |
| Func<T, bool> | isProjectOwned | True when a candidate lives in the user's own project content. |
| Func<T, string> | idOf | The candidate's |
| SingletonSelectionOutcome | outcome | How the pick was made — see SingletonSelectionOutcome. |
Returns
| Type | Description |
|---|---|
| T | The picked candidate, or |
Type Parameters
| Name | Description |
|---|---|
| T |