"CodeElements
" sounds as if you are using the EnvDTE interfaces to gain access to your enumerations. If so, all enum items are in the Members
-Property of the EnvDTE.CodeEnum
type. They are of type EnvDTE.CodeVariable
and the explicit value is stored in the InitExpression
of the Variable.
Have a look at this Enum:
// C# Enum to reflect
public enum MyEnum { Hi = 10, There = 15 }
And this T4 CodeSnippet reflecting the Enum:
<#
// the enumeration object you already seem to have
EnvDTE.CodeEnum theEnum;
// iterate all enumeration items
foreach(EnvDTE.CodeVariable variable in theEnum.Members)
{
// render name and value
#><#= variable.Prototype #> = <#= variable.InitExpression.ToString() #>
<#}
#>
Should result in:
Hi = 10
There = 15
Hope that helps.