private string Transform ( [NotNull] string symbol, [CanBeNull] string prefix = null, SymbolTransformationMethod method = None ) { prefix = prefix ?? string.Empty; var concatenated = $"{prefix}{symbol}"; switch (method) { case None: { return(concatenated); } case Pascalize: { return(concatenated.Pascalize()); } case Camelize: { return(concatenated.Camelize()); } case Underscore: { return(concatenated.Underscore()); } case Dasherize: { return(concatenated.Dasherize()); } case Kebaberize: { return(concatenated.Kebaberize()); } default: { throw new ArgumentOutOfRangeException(nameof(method), method, null); } } }
/// <summary> /// Initializes a new instance of the <see cref="NativeSymbolsAttribute"/> class. /// </summary> /// <param name="prefix">The symbol prefix to use.</param> /// <param name="symbolTransformationMethod">The expansion method for symbols.</param> public NativeSymbolsAttribute([NotNull] string prefix, SymbolTransformationMethod symbolTransformationMethod) { Prefix = prefix; SymbolTransformationMethod = symbolTransformationMethod; }