Class HudBindingCompiler
Turns an authored IHudBinding into a CompiledHudBinding by resolving its source type and walking its member chain once.
Inherited Members
Namespace: Serenity.GameUi.Application.Binding
Assembly: Serenity.GameUi.Application.dll
Syntax
public static class HudBindingCompiler
Remarks
Engine-free on purpose: directly-referenced sources arrive as plain objects and services arrive through an injected resolver, so the whole binding layer is unit testable without a locator or an editor.
Methods
Compile(IHudBinding, Func<Type, object>, object, Func<string, Type>)
Compiles a binding.
Declaration
public static CompiledHudBinding Compile(IHudBinding binding, Func<Type, object> serviceResolver = null, object directReference = null, Func<string, Type> typeResolver = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IHudBinding | binding | The authored binding. |
| Func<Type, object> | serviceResolver | Resolves a service contract to its instance, or null when it is not registered yet. Called on every read until it first succeeds, so a HUD built before the service locator is populated recovers on its own instead of caching the miss forever. |
| object | directReference | The referenced object, for scene-object and asset sources. |
| Func<string, Type> | typeResolver | Resolves a type name. Defaults to a tolerant search across the loaded assemblies. |
Returns
| Type | Description |
|---|---|
| CompiledHudBinding | A readable binding, or an invalid one carrying the reason. |