Exemplo n.º 1
0
        private static MatcherModel Map([CanBeNull] IMatcher matcher)
        {
            if (matcher == null)
            {
                return(null);
            }

            IStringMatcher stringMatcher = matcher as IStringMatcher;

            string[] patterns = stringMatcher != null?stringMatcher.GetPatterns() : new string[0];

            return(new MatcherModel
            {
                Name = matcher.GetName(),
                Pattern = patterns.Length == 1 ? patterns.First() : null,
                Patterns = patterns.Length > 1 ? patterns : null
            });
        }