예제 #1
0
        public IEnumerable <BrokenRuleEncounteredException> GetAnyBrokenRules(IEnumerable <ICSSFragment> fragments)
        {
            if (fragments == null)
            {
                throw new ArgumentNullException("fragments");
            }

            var fragmentSet = new CSSFragmentSet(fragments);

            if (fragmentSet.TotalSelectorCount > MAX_NUMBER_OF_SELECTORS)
            {
                yield return(new LegacyIESelectorLimitMustBeRespectedException(fragmentSet));
            }
        }
예제 #2
0
            private static string GetMessage(CSSFragmentSet fragmentSet, string optionalAdditionalMessageContent)
            {
                if (fragmentSet == null)
                {
                    throw new ArgumentNullException("fragmentSet");
                }

                var message = string.Format(
                    "Legacy IE (pre-v10) Selector Limit ({0}) exceeded ({1})",
                    MAX_NUMBER_OF_SELECTORS,
                    fragmentSet.TotalSelectorCount
                    );

                if (!string.IsNullOrWhiteSpace(optionalAdditionalMessageContent))
                {
                    message += ": " + optionalAdditionalMessageContent;
                }
                return(message);
            }
예제 #3
0
 public LegacyIESelectorLimitMustBeRespectedException(string additionalMessageContent, CSSFragmentSet fragmentSet)
     : base(GetMessage(fragmentSet, additionalMessageContent), fragmentSet)
 {
 }
예제 #4
0
 public LegacyIESelectorLimitMustBeRespectedException(CSSFragmentSet fragmentSet) : base(GetMessage(fragmentSet, null), fragmentSet)
 {
 }