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); }
public string ResolvePropertyName(CamelCaseNamingStrategy namingStragegy, string name) { return(XStrings.ToCamelCase(name)); }
public static string ToCamelCase(this string s) { return(XStrings.ToCamelCase(s)); }