private string GetEnumValueFromField(StringField f, DataDictionary.DDField field) { if (field == null || !field.HasEnums()) return null; else { string enumValue = string.Empty; string[] values = f.getValue().Split(' '); StringBuilder sb = new StringBuilder(); foreach (string val in values) { if (field.EnumDict.TryGetValue(val, out enumValue)) { sb.AppendFormat("{0}, ", enumValue); } } string res = sb.ToString(); if (!string.IsNullOrEmpty(res)) { res = res.TrimEnd(' ', ','); } return res; } }