Class CodeEnum<TEnum, TCode>
Abstract class for extending enums including converting codes to enum constants.
Inherited Members
Namespace: PushTechnology.DiffusionCore
Assembly: Diffusion.Client.dll
Syntax
public abstract class CodeEnum<TEnum, TCode> : AdvancedEnum<TEnum> where TEnum : CodeEnum<TEnum, TCode>
Type Parameters
Name | Description |
---|---|
TEnum | The enum constant. |
TCode | The byte representation of the enum. |
Properties
Code
Returns the byte representation of the enum constant.
Declaration
public TCode Code { get; protected set; }
Property Value
Type | Description |
---|---|
TCode | The byte representation of the enum constant. |
Enum
Returns the enum.
Declaration
public TEnum Enum { get; protected set; }
Property Value
Type | Description |
---|---|
TEnum | The enum. |
Methods
FromCode(TCode)
Returns the constant associated with the given code.
Declaration
public static TEnum FromCode(TCode code)
Parameters
Type | Name | Description |
---|---|---|
TCode | code | The byte representation of the enum constant. |
Returns
Type | Description |
---|---|
TEnum | The constant associated with the given code. |