Beispiel #1
0
        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);
        }
Beispiel #2
0
 public NamingConventionSwitcher(ICaseConvention codedCase, ICaseConvention defaultOutputCase, IEnumerable <ICaseConvention> allowedCases)
 {
     CodedCase         = codedCase;
     DefaultOutputCase = defaultOutputCase;
     AllowedCases      = allowedCases;
 }
Beispiel #3
0
        public string ConvertSpecifiedToDefault(string fieldName, ICaseConvention caseConvention)
        {
            IEnumerable <string> words = caseConvention.Split(fieldName);

            return(DefaultOutputCase.Make(words));
        }
Beispiel #4
0
 public NamingConventionSwitcher(ICaseConvention codedCase, ICaseConvention defaultOutputCase)
 {
     CodedCase         = codedCase;
     DefaultOutputCase = defaultOutputCase;
     AllowedCases      = new[] { defaultOutputCase };
 }