Class RecordLinks
- Namespace
- Chronicler
- Assembly
- Chronicler.dll
Records stable IDs for links to host-owned values.
public static class RecordLinks
- Inheritance
-
RecordLinks
- Inherited Members
Methods
LookDeferred<T>(IChronicler, T, string, Action<T>, string?)
Records a link whose assignment may wait until the graph has loaded.
public static void LookDeferred<T>(IChronicler chronicler, T value, string name, Action<T> assignLoadedValue, string? slot = null)
Parameters
chroniclerIChroniclerThe active pass supplied to RecordData(IChronicler).
valueTThe value to identify on save. The callback applies any loaded value.
namestringThe stable field name to use on both save and load.
assignLoadedValueAction<T>Applies the resolved value, or the default of
Tfor a missing or null entry. The load context retains this callback while the link is queued.slotstringAn optional identity domain. Null or empty selects the default slot.
Type Parameters
TThe declared type used for registry lookup.
Remarks
On load, the callback runs immediately if the target is available or the entry is missing or null. Otherwise, ResolveDeferredLinks() invokes it when the target resolves.
Exceptions
- ArgumentNullException
assignLoadedValueis null.- InvalidOperationException
A non-null value has no stable ID on save.
Look<T>(IChronicler, ref T, string, string?)
Records a link that must resolve as soon as it is read.
public static void Look<T>(IChronicler chronicler, ref T value, string name, string? slot = null)
Parameters
chroniclerIChroniclerThe active pass supplied to RecordData(IChronicler).
valueTThe value to identify on save. On load, receives the resolved value or the default for a missing or null entry. An unresolved ID leaves this value unchanged.
namestringThe stable field name to use on both save and load.
slotstringAn optional identity domain. Null or empty selects the default slot.
Type Parameters
TThe declared type used for registry lookup.
Exceptions
- InvalidOperationException
A non-null value has no stable ID on save, or a present link ID cannot resolve on load.