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

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