Example #1
0
        public static string Convert(NameSemantic semantic)
        {
            var rules = NameConvertor.GetRules(semantic);

            foreach (var rule in rules)
            {
                if (NameConvertor.IsRuleAcceptable(semantic, rule))
                {
                    return(NameConvertor.ApplyRule(semantic, rule));
                }
            }

            return(NameConvertor.ApplyRule(semantic, null));
        }
Example #2
0
        public static string Convert(NameSemantic semantic)
        {
            var    rules      = NameConvertor.GetRules(semantic);
            string customName = null;

            foreach (var rule in rules)
            {
                if (NameConvertor.IsRuleAcceptable(semantic, rule))
                {
                    if (!string.IsNullOrWhiteSpace(rule.CustomName))
                    {
                        customName = rule.CustomName;
                        continue;
                    }
                    return(NameConvertor.ApplyRule(semantic, rule, customName));
                }
            }

            return(NameConvertor.ApplyRule(semantic, null, customName));
        }