using DPumpHydr.WinFrmUI.WenSkin.Json.Utilities;
namespace DPumpHydr.WinFrmUI.WenSkin.Json.Serialization
{
///
/// A snake case naming strategy.
///
public class SnakeCaseNamingStrategy : NamingStrategy
{
///
/// Initializes a new instance of the class.
///
///
/// A flag indicating whether dictionary keys should be processed.
///
///
/// A flag indicating whether explicitly specified property names should be processed,
/// e.g. a property name customized with a .
///
public SnakeCaseNamingStrategy(bool processDictionaryKeys, bool overrideSpecifiedNames)
{
base.ProcessDictionaryKeys = processDictionaryKeys;
base.OverrideSpecifiedNames = overrideSpecifiedNames;
}
///
/// Initializes a new instance of the class.
///
public SnakeCaseNamingStrategy()
{
}
///
/// Resolves the specified property name.
///
/// The property name to resolve.
/// The resolved property name.
protected override string ResolvePropertyName(string name)
{
return StringUtils.ToSnakeCase(name);
}
}
}