Exemplo n.º 1
0
        public string ToEnumName(Type enumType, string enumText, bool camelCaseText)
        {
            BidirectionalDictionary <string, string> map = EnumMemberNamesPerType.Get(enumType);

            string[] names = enumText.Split(',');
            for (int i = 0; i < names.Length; i++)
            {
                string name = names[i].Trim();

                string resolvedEnumName;
                map.TryGetByFirst(name, out resolvedEnumName);
                resolvedEnumName = resolvedEnumName ?? name;

                if (camelCaseText)
                {
                    resolvedEnumName = XStrings.ToCamelCase(resolvedEnumName);
                }

                names[i] = resolvedEnumName;
            }

            string finalName = String.Join(", ", names);

            return(finalName);
        }
Exemplo n.º 2
0
 public string ResolvePropertyName(CamelCaseNamingStrategy namingStragegy, string name)
 {
     return(XStrings.ToCamelCase(name));
 }
Exemplo n.º 3
0
 public static string ToCamelCase(this string s)
 {
     return(XStrings.ToCamelCase(s));
 }