Class VBRuntimeUserDefinedTypeValue
Wraps a VBUserDefinedTypeValue for storage inside an IRuntimeValue, so the
UDT (its field cells included) round-trips through ISessionStorage like any other value.
public sealed class VBRuntimeUserDefinedTypeValue
- Inheritance
-
VBRuntimeUserDefinedTypeValue
- Inherited Members
Remarks
The same problem VBRuntimeArrayValue solves, and the same solution: a UDT's real content is
its fields, which a scalar IRuntimeValue — an int, a VBRuntimeReference — has
nowhere to hold, so reading the variable back would hand out a UDT with default fields however much had
been assigned to it.
👉 Deliberately a plain reference type, not a record: Equals(object)
compares Handle.Value.BoxedValue, so boxing through a structurally-equatable wrapper would compare
two UDTs by calling back into VBUserDefinedTypeValue's own equality — which reads through
this same boxed value — recursing forever. A plain class's reference equality breaks the cycle.
Constructors
VBRuntimeUserDefinedTypeValue(VBUserDefinedTypeValue)
Wraps a VBUserDefinedTypeValue for storage inside an IRuntimeValue, so the
UDT (its field cells included) round-trips through ISessionStorage like any other value.
public VBRuntimeUserDefinedTypeValue(VBUserDefinedTypeValue userDefinedType)
Parameters
userDefinedTypeVBUserDefinedTypeValueThe UDT value to wrap.
Remarks
The same problem VBRuntimeArrayValue solves, and the same solution: a UDT's real content is
its fields, which a scalar IRuntimeValue — an int, a VBRuntimeReference — has
nowhere to hold, so reading the variable back would hand out a UDT with default fields however much had
been assigned to it.
👉 Deliberately a plain reference type, not a record: Equals(object)
compares Handle.Value.BoxedValue, so boxing through a structurally-equatable wrapper would compare
two UDTs by calling back into VBUserDefinedTypeValue's own equality — which reads through
this same boxed value — recursing forever. A plain class's reference equality breaks the cycle.
Properties
UserDefinedType
The wrapped UDT, fields and all.
public VBUserDefinedTypeValue UserDefinedType { get; }