Class HudMemberAccessor
One resolved hop of a HUD binding chain: a field, property or method located on a type once, then read many times.
Inherited Members
Namespace: Serenity.GameUi.Application.Binding
Assembly: Serenity.GameUi.Application.dll
Syntax
public sealed class HudMemberAccessor
Remarks
Resolution happens at compile time and the arguments are converted once, so a per-frame read is a reflection invoke on cached metadata rather than a fresh lookup.
Properties
MemberName
The member's name, for diagnostics.
Declaration
public string MemberName { get; }
Property Value
| Type | Description |
|---|---|
| string |
ResultType
The static type this step produces, used to classify the value and pick a representation.
Declaration
public Type ResultType { get; }
Property Value
| Type | Description |
|---|---|
| Type |
Methods
TryRead(object, out object)
Reads this step's value from an instance (null for a static member).
Declaration
public bool TryRead(object instance, out object value)
Parameters
| Type | Name | Description |
|---|---|---|
| object | instance | The object to read from. |
| object | value | The value read, when the read produced one. |
Returns
| Type | Description |
|---|---|
| bool | False when the read threw, or when a try-style method reported no value. |
TryResolve(Type, IHudMemberStep, Func<string, Type>, out HudMemberAccessor, out string)
Resolves one step against the type it is evaluated on.
Declaration
public static bool TryResolve(Type declaringType, IHudMemberStep step, Func<string, Type> typeResolver, out HudMemberAccessor accessor, out string error)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | declaringType | The type the step reads from. |
| IHudMemberStep | step | The authored step. |
| Func<string, Type> | typeResolver | Resolves an assembly-qualified argument type name. |
| HudMemberAccessor | accessor | The resolved accessor, when resolution succeeded. |
| string | error | Why resolution failed, when it did. |
Returns
| Type | Description |
|---|---|
| bool | True when the step resolved. |