public static IEnumerable <SoftEnumBase> ListValues(SoftEnumType type) { SoftEnumBase[] values = new SoftEnumBase[type.m_values.Length]; Array.Copy(type.m_values, values, type.m_values.Length); foreach (var val in values) { yield return(val); } }
public IEnumerable <SoftEnum <TType> > Values <TType>() where TType : SoftEnumType, new() { SoftEnumBase[] values = new SoftEnumBase[m_values.Length]; Array.Copy(m_values, values, m_values.Length); foreach (var val in values) { yield return(val as SoftEnum <TType>); } }