Example #1
0
        /// <summary>
        /// Transforms the case of the expression description, based on options
        /// </summary>
        /// <param name="description">The description to transform</param>
        /// <param name="caseType">The casing type that controls the output casing</param>
        /// <returns>The transformed description with proper casing</returns>
        protected string TransformCase(string description, CasingTypeEnum caseType)
        {
            switch (caseType)
            {
            case CasingTypeEnum.Sentence:
                description = string.Concat(Thread.CurrentThread.CurrentCulture.TextInfo.ToUpper(description[0]), description.Substring(1));
                break;

            case CasingTypeEnum.Title:
                description = Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(description);
                break;

            default:
                description = description.ToLower();
                break;
            }
            return(description);
        }
        /// <summary>
        /// Transforms the case of the expression description, based on options
        /// </summary>
        /// <param name="description">The description to transform</param>
        /// <param name="caseType">The casing type that controls the output casing</param>
        /// <returns>The transformed description with proper casing</returns>
        protected string TransformCase(string description, CasingTypeEnum caseType)
        {
            switch (caseType)
            {
                case CasingTypeEnum.Sentence:
                    description = string.Concat(Thread.CurrentThread.CurrentCulture.TextInfo.ToUpper(description[0]), description.Substring(1));
                    break;
                case CasingTypeEnum.Title:
                    description = Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(description);
                    break;
                default:
                    description = description.ToLower();
                    break;

            }
            return description;
        }