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)); } }
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); }
public LegacyIESelectorLimitMustBeRespectedException(string additionalMessageContent, CSSFragmentSet fragmentSet) : base(GetMessage(fragmentSet, additionalMessageContent), fragmentSet) { }
public LegacyIESelectorLimitMustBeRespectedException(CSSFragmentSet fragmentSet) : base(GetMessage(fragmentSet, null), fragmentSet) { }