private string ConvertRequested(string requestedFieldName, ICaseConvention caseConvention) { foreach (ICaseConvention allowedCase in AllowedCases) { if (allowedCase.IsCase(requestedFieldName)) { IEnumerable <string> words = allowedCase.Split(requestedFieldName); return(caseConvention.Make(words)); } } return(requestedFieldName); }
public NamingConventionSwitcher(ICaseConvention codedCase, ICaseConvention defaultOutputCase, IEnumerable <ICaseConvention> allowedCases) { CodedCase = codedCase; DefaultOutputCase = defaultOutputCase; AllowedCases = allowedCases; }
public string ConvertSpecifiedToDefault(string fieldName, ICaseConvention caseConvention) { IEnumerable <string> words = caseConvention.Split(fieldName); return(DefaultOutputCase.Make(words)); }
public NamingConventionSwitcher(ICaseConvention codedCase, ICaseConvention defaultOutputCase) { CodedCase = codedCase; DefaultOutputCase = defaultOutputCase; AllowedCases = new[] { defaultOutputCase }; }