Class FoundationReferenceContract
One declarative row describing a single cross-asset string reference an IFoundationSettings
owner type holds: which serialized property carries it, whether the stored value is a Serenity
Id or Guid (or the owner's own post-rename Id, for a self-reference like
UiOption.ViewId), which settings type the value must resolve against, and how the value's
shape must be treated when it is read or rewritten. See FoundationReferenceContracts
for the full table this feeds.
Inheritance
FoundationReferenceContract
Assembly: Serenity.Global.Application.dll
Syntax
public sealed class FoundationReferenceContract
Constructors
FoundationReferenceContract(string, string, FoundationReferenceKind, string, string, FoundationReferenceSelector, FoundationReferenceShape, string, string)
Declaration
public FoundationReferenceContract(string ownerTypeName, string propertyPath, FoundationReferenceKind kind, string referencedTypeName, string referencedTypeNamePropertyPath, FoundationReferenceSelector selector, FoundationReferenceShape shape, string documentation, string elementTypeFullName = null)
Parameters
Properties
Documentation
Declaration
public string Documentation { get; }
Property Value
| Type |
Description |
| string |
Why this reference exists — surfaced to an authoring agent through the discovery registry.
|
ElementTypeFullName
Declaration
public string ElementTypeFullName { get; }
Property Value
| Type |
Description |
| string |
For a field that belongs to one concrete type of a polymorphic [SerializeReference] member (a
signal inside a signal list): that type's full name (namespace and name, a nested type joined to its
host with a plus, nothing before the name for a type in the global namespace), so the row applies only
to an element that IS that type — never to one that merely shares its short name. Null for every other row.
|
Kind
Declaration
public FoundationReferenceKind Kind { get; }
Property Value
OwnerTypeName
Declaration
public string OwnerTypeName { get; }
Property Value
| Type |
Description |
| string |
Short (non-namespaced) type name of the IFoundationSettings owner this row describes.
|
PropertyPath
Declaration
public string PropertyPath { get; }
Property Value
| Type |
Description |
| string |
Serialized property path on the owner, resolved segment by segment via
SerializedObject.FindProperty/SerializedProperty.FindPropertyRelative. A segment
written Foo[] marks a collection element, expanded into Foo.Array.data[N] for
every element the collection holds.
|
ReferencedTypeName
Declaration
public string ReferencedTypeName { get; }
Property Value
| Type |
Description |
| string |
Short type name the value must resolve against, or null when ReferencedTypeNamePropertyPath
supplies it instead, or when any IFoundationSettings type is acceptable.
|
ReferencedTypeNamePropertyPath
Declaration
public string ReferencedTypeNamePropertyPath { get; }
Property Value
| Type |
Description |
| string |
Path to a sibling string field on the OWNER (not the collection element) that names the
referenced type at authoring time — e.g. UnityGameSettingsDefinition.selectableValueTypeName
for its own Options/DefaultValue. Null when ReferencedTypeName is fixed.
|
Selector
Declaration
public FoundationReferenceSelector Selector { get; }
Property Value
| Type |
Description |
| FoundationReferenceSelector |
Which run-time condition on the owning asset decides whether this row applies to a given element.
|
Shape
Declaration
public FoundationReferenceShape Shape { get; }
Property Value
Methods
AssetKeyReference(string, string, string)
Declares a row whose value is another asset's Addressables load key (its address) — see
AssetKeyReferenceContracts, which synthesises one of these per concrete
[AssetPathField] site rather than declaring a fixed row here.
Declaration
public static FoundationReferenceContract AssetKeyReference(string ownerTypeName, string propertyPath, string documentation)
Parameters
Returns
GuidReference(string, string, string, FoundationReferenceSelector, string, string, FoundationReferenceShape)
Declares a row whose value is another asset's Guid.
Declaration
public static FoundationReferenceContract GuidReference(string ownerTypeName, string propertyPath, string referencedTypeName, FoundationReferenceSelector selector, string documentation, string referencedTypeNamePropertyPath = null, FoundationReferenceShape shape = 0)
Parameters
Returns
IdReference(string, string, string, FoundationReferenceSelector, string, string, FoundationReferenceShape)
Declares a row whose value is another asset's Id.
Declaration
public static FoundationReferenceContract IdReference(string ownerTypeName, string propertyPath, string referencedTypeName, FoundationReferenceSelector selector, string documentation, string referencedTypeNamePropertyPath = null, FoundationReferenceShape shape = 0)
Parameters
Returns
OwnerIdReference(string, string, string)
Declares a self-reference row: the value is the OWNER's own Id, rewritten to its post-rename value.
Declaration
public static FoundationReferenceContract OwnerIdReference(string ownerTypeName, string propertyPath, string documentation)
Parameters
Returns