Add backwards compatible EnumUtils.TryToString call
This commit is contained in:
@@ -117,6 +117,13 @@ namespace Newtonsoft.Json.Utilities
|
|||||||
return selectedFlagsValues;
|
return selectedFlagsValues;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Used by Newtonsoft.Json.Schema
|
||||||
|
private static CamelCaseNamingStrategy _camelCaseNamingStrategy = new CamelCaseNamingStrategy();
|
||||||
|
public static bool TryToString(Type enumType, object value, bool camelCase, out string name)
|
||||||
|
{
|
||||||
|
return TryToString(enumType, value, camelCase ? _camelCaseNamingStrategy : null, out name);
|
||||||
|
}
|
||||||
|
|
||||||
public static bool TryToString(Type enumType, object value, NamingStrategy namingStrategy, out string name)
|
public static bool TryToString(Type enumType, object value, NamingStrategy namingStrategy, out string name)
|
||||||
{
|
{
|
||||||
EnumInfo enumInfo = ValuesAndNamesPerEnum.Get(new StructMultiKey<Type, NamingStrategy>(enumType, namingStrategy));
|
EnumInfo enumInfo = ValuesAndNamesPerEnum.Get(new StructMultiKey<Type, NamingStrategy>(enumType, namingStrategy));
|
||||||
|
|||||||
Reference in New Issue
Block a user