예제 #1
0
        public static string GetOption(this VoteOption value)
        {
            DescriptionAttribute[] attributes = (DescriptionAttribute[])value
                                                .GetType()
                                                .GetField(value.ToString())
                                                .GetCustomAttributes(typeof(DescriptionAttribute), false);

            return(attributes.Length > 0 ? attributes[0].Description : string.Empty);
        }
예제 #2
0
 public void SetOption(VoteOption src)
 {
     Option = src.ToString();
 }