示例#1
0
        public static EstimaatorMethods StringToEnumMethods(string enumVal)
        {
            EstimaatorMethods enumResult = new EstimaatorMethods();

            try
            {
                enumResult = (EstimaatorMethods)Enum.Parse(typeof(EstimaatorMethods), enumVal);
            }
            catch (ArgumentException ex)
            {
                // Not Handled
            }

            return(enumResult);
        }
示例#2
0
 public static string EnumToString(this EstimaatorMethods val)
 {
     DescriptionAttribute[] attributes = (DescriptionAttribute[])val.GetType().GetField(val.ToString()).GetCustomAttributes(typeof(DescriptionAttribute), false);
     return(attributes.Length > 0 ? attributes[0].Description : string.Empty);
 }