Class VBTypedValue
Represents any typed value.
[JsonConverter(typeof(VBTypedValueJsonConverter))]
public abstract record VBTypedValue : IEquatable<VBTypedValue>
- Inheritance
-
VBTypedValue
- Implements
- Derived
- Inherited Members
Remarks
This class is at the base of the type hierarchy for all typed values.
Constructors
VBTypedValue(VBType)
Represents any typed value.
protected VBTypedValue(VBType TypeInfo)
Parameters
TypeInfoVBTypeThe
VBTypeof the value.
Remarks
This class is at the base of the type hierarchy for all typed values.
VBTypedValue(VBType, IRuntimeValue)
protected VBTypedValue(VBType typeInfo, IRuntimeValue value)
Parameters
typeInfoVBTypevalueIRuntimeValue
VBTypedValue(VBType, VBRuntimeReference)
protected VBTypedValue(VBType typeInfo, VBRuntimeReference reference)
Parameters
typeInfoVBTypereferenceVBRuntimeReference
VBTypedValue(VBType, VBRuntimeVariantValue)
protected VBTypedValue(VBType typeInfo, VBRuntimeVariantValue variant)
Parameters
typeInfoVBTypevariantVBRuntimeVariantValue
Properties
Handle
public IBindingHandle Handle { get; init; }
Property Value
RuntimeValue
The runtime value this typed value is currently bound to.
public IRuntimeValue RuntimeValue { get; }
Property Value
Size
The allocated size (in bytes) of this value.
public abstract int Size { get; }
Property Value
TypeInfo
The VBType of the value.
public VBType TypeInfo { get; init; }
Property Value
Methods
Describe()
Creates a new VBTypeDescValue that describes this value.
public VBTypeDescValue Describe()
Returns
Equals(VBTypedValue?)
Two typed values are equal when they have the exact same value type and hold equal managed values.
public virtual bool Equals(VBTypedValue? other)
Parameters
otherVBTypedValue
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
GetTargetType()
Gets the described Target type of this value if the value is a VBTypeDescValue; yields the TypeInfo of this value otherwise.
public VBType GetTargetType()
Returns
Remarks
👉 The TypeInfo of a type descriptor value is a VBTypeDesc.
PrintMembers(StringBuilder)
Prints this VBTypedValue's members for ToString().
protected virtual bool PrintMembers(StringBuilder builder)
Parameters
builderStringBuilder
Returns
Remarks
Prints TypeInfo by Name rather than the VBType
instance itself: that type's own DefaultValue is this kind of value, so
letting the compiler-generated ToString print the full TypeInfo object would
recurse between the two PrintMembers implementations forever.
WithRuntimeValue(IRuntimeValue)
Returns a copy of this value bound to runtimeValue.
public VBTypedValue WithRuntimeValue(IRuntimeValue runtimeValue)
Parameters
runtimeValueIRuntimeValue