Isn't this stuff so damned awkward! You will need a CodeTypeReferenceExpression to get the enum type and a CodeFieldReferenceExpression to get a value.
For example (in C#, sorry about that)
private CodeMemberMethod CreateGetEnumMethod() {
CodeMemberMethod method = new CodeMemberMethod();
method.Attributes = MemberAttributes.Public | MemberAttributes.Final;
method.Name = "GetDay";
method.ReturnType = new CodeTypeReference(typeof(DayOfWeek));
CodeTypeReferenceExpression enumType = new CodeTypeReferenceExpression(typeof(DayOfWeek));
CodeFieldReferenceExpression enumValue = new CodeFieldReferenceExpression(enumType, "Saturday");
method.Statements.Add(new CodeMethodReturnStatement(enumValue));
return method;
}
Alan.