public static string GetStringValue(WorkType Val) { string str = null; StringValue[] customAttributes = Val.GetType().GetField(Val.ToString()).GetCustomAttributes(typeof(StringValue), false) as StringValue[]; if (customAttributes.Length > 0) { str = customAttributes[0].GetStr(); } return(str); }