Exemplo n.º 1
0
        public static string GetDefaultHelpText <TEnum>(bool multiline = false) where TEnum : struct
        {
            IEnumerable <string> values = Enum.GetValues(typeof(TEnum))
                                          .Cast <TEnum>()
                                          .Select(f => _lowerLetterUpperLetterRegex.Replace(f.ToString(), e => e.Value.Insert(1, "-")).ToLowerInvariant())
                                          .OrderBy(f => f);

            if (multiline)
            {
                return(string.Join(Environment.NewLine + "  ", values));
            }
            else
            {
                return(TextHelpers.Join(", ", " and ", values));
            }
        }