Beispiel #1
0
        /// <summary>
        /// Default ctor
        /// </summary>
        public PatternInclude(string pattern, bool applyToMembers, bool isGlobal)
        {
            if (pattern == null)
            {
                throw new ArgumentNullException("pattern");
            }

            IsGlobal = isGlobal;

            _pattern = PatternParser.ParseMatcher(pattern, applyToMembers);
            if (IsEmpty)
            {
                return;
            }


            bool hasInclude     = _pattern.Attributes.Any(a => a == "Dot42.Include");
            bool hasIncludeType = _pattern.Attributes.Any(a => a == "Dot42.IncludeType");

            if (hasIncludeType)
            {
                _pattern.ApplyToMembers = true;
            }
            else if (!hasInclude)
            {
                _pattern = null;
            }
        }