IEnumerationPropertyProvider<TStruct> Interface
Provides additional properties mapped to specific values of enumeration-like structs (i.e. Flag, FunctionType, etc.).
public interface IEnumerationPropertyProvider<TStruct> where TStruct : struct, HAKOM.TSM.Net.Api.IEnumeration<TStruct>, System.IEquatable<TStruct>, System.ValueType, System.ValueTypeType parameters
Section titled “Type parameters”TStruct
The enumeration-like type for which this instance provides additional properties.
Remarks
Section titled “Remarks”IEnumeration<TStruct> implementing types are used to represent data similarly to the way how an enum works, but with added functionality and sometimes even the ability to extend them via configuration. Under the hood, these types are still represented by a single value (i.e. System.Byte, System.Int32, etc.) to keep their memory footprint as small as possible. In order to add properties to these values without attaching them to each instance of the TStruct, implementations of this interface may be used to map TStruct values to additional information, for example a human-readable string representation, etc.
Properties
Section titled “Properties”IEnumerationPropertyProvider<TStruct>.MappedProperties Property
Section titled “IEnumerationPropertyProvider<TStruct>.MappedProperties Property”Gets all property values mapped to specific values of TStruct.
System.Collections.Generic.IReadOnlyDictionary<TStruct,object> MappedProperties { get; }Property Value
Section titled “Property Value”System.Collections.Generic.IReadOnlyDictionary<TStruct,System.Object>
IEnumerationPropertyProvider<TStruct>.PropertyName Property
Section titled “IEnumerationPropertyProvider<TStruct>.PropertyName Property”The name of the property for which this instance provides values.
string PropertyName { get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”IEnumerationPropertyProvider<TStruct>.TryGetProperty(IEnumeration<TStruct>, object) Method
Section titled “IEnumerationPropertyProvider<TStruct>.TryGetProperty(IEnumeration<TStruct>, object) Method”Attempts to get the value of an additional property that has been mapped to a specific value of TStruct.
bool TryGetProperty(HAKOM.TSM.Net.Api.IEnumeration<TStruct> value, out object property);Parameters
Section titled “Parameters”value HAKOM.TSM.Net.Api.IEnumeration<TStruct>
The TStruct value to look up the property value for
property System.Object
The mapped property.
Returns
Section titled “Returns”System.Boolean
true if there is a mapped property value for the given value of TStruct, false otherwise.
IEnumerationPropertyProvider<TStruct>.TryGetProperty(TStruct, object) Method
Section titled “IEnumerationPropertyProvider<TStruct>.TryGetProperty(TStruct, object) Method”Attempts to get the value of an additional property that has been mapped to a specific value of TStruct.
bool TryGetProperty(TStruct value, out object property);Parameters
Section titled “Parameters”value TStruct
The TStruct value to look up the property value for
property System.Object
The mapped property.
Returns
Section titled “Returns”System.Boolean
true if there is a mapped property value for the given value of TStruct, false otherwise.