Class VBUserDefinedType
Represents any User-Defined Type (UDT) structure.
public record VBUserDefinedType : VBType, IEquatable<VBType>, IVBMemberOwnerType, IEquatable<VBUserDefinedType>
- Inheritance
-
VBUserDefinedType
- Implements
- Derived
- Inherited Members
Constructors
VBUserDefinedType(Symbol, ImmutableArray<VBTypeMemberSymbol>)
Represents any User-Defined Type (UDT) structure.
public VBUserDefinedType(Symbol Symbol, ImmutableArray<VBTypeMemberSymbol> Members)
Parameters
SymbolSymbolThe symbol associated with this UDT.
MembersImmutableArray<VBTypeMemberSymbol>The members (fields) of the UDT.
Properties
DefaultValue
Gets the default value for this data type.
public override VBTypedValue DefaultValue { get; }
Property Value
Remarks
⚠️ Derived types must back the implementation of this property with a thread-safe private static readonly Lazy<T>.
Failure to do so would lock up the static context initialization of the StaticSymbol symbols.
Members
The members (fields) of the UDT.
public ImmutableArray<VBTypeMemberSymbol> Members { get; init; }
Property Value
Size
The size (in bytes) of a value of this type.
public override int Size { get; }
Property Value
Remarks
Determines the length of the allocated memory space for a value of this type.
Symbol
The symbol associated with this UDT.
public Symbol Symbol { get; init; }
Property Value
Methods
Equals(VBUserDefinedType?)
Indicates whether the current object is equal to another object of the same type.
public virtual bool Equals(VBUserDefinedType? other)
Parameters
otherVBUserDefinedTypeAn object to compare with this object.
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
WithMembers(IEnumerable<VBTypeMemberSymbol>)
Gets a copy of this type with the specified members.
public IVBMemberOwnerType WithMembers(IEnumerable<VBTypeMemberSymbol> members)
Parameters
membersIEnumerable<VBTypeMemberSymbol>The members of the new type.