Esempio n. 1
0
        /// <summary>
        /// Constructs a new UrlFilter instance. Note that UrlFilter objects, nor any Filter object,
        /// are meant to be constructed outside of the AbpFormatRuleParser class.
        /// </summary>
        /// <param name="originalRule">
        /// The original rule string used to build this filter.
        /// </param>
        /// <param name="parts">
        /// The UrlFilterFragment parts that make up this filter.
        /// </param>
        /// <param name="options">
        /// The filter options.
        /// </param>
        /// <param name="applicableDomains">
        /// Domains that the filter should be applied to.
        /// </param>
        /// <param name="exceptionDomains">
        /// Domains that the filter should not be applied to.
        /// </param>
        /// <param name="applicableReferers">
        /// Referers that the filter rule should be applied to.
        /// </param>
        /// <param name="exceptionReferers">
        /// Referers that the filter rule should not be applied to.
        /// </param>
        /// <param name="cspOption">
        /// Content Security Policy to be injected into HTTP responses for requested documents matching the filter.
        /// </param>
        /// <param name="isException">
        /// Whether or not the filter is an exception, that is to say, a whitelisting filter.
        /// </param>
        /// <param name="categoryId">
        /// The category ID of the category this filter belongs to.
        /// </param>
        internal UrlFilter(string originalRule, List <UrlFilteringRuleFragment> parts, UrlFilterOptions options, ICollection <string> applicableDomains, ICollection <string> exceptionDomains, ICollection <string> applicableReferers, ICollection <string> exceptionReferers, string cspOption, bool isException, short categoryId) : base(originalRule, isException, categoryId)
        {
            Parts   = parts;
            Options = options;

            if (applicableDomains != null)
            {
                ApplicableDomains = applicableDomains;
            }

            if (exceptionDomains != null)
            {
                ExceptionDomains = exceptionDomains;
            }

            if (applicableReferers != null)
            {
                ApplicableReferers = applicableReferers;
            }

            if (exceptionReferers != null)
            {
                ExceptReferers = exceptionReferers;
            }

            CspOption = cspOption;
        }
Esempio n. 2
0
        /// <summary>
        /// Constructs a new UrlFilter instance. Note that UrlFilter objects, nor any Filter object,
        /// are meant to be constructed outside of the AbpFormatRuleParser class.
        /// </summary>
        /// <param name="originalRule">
        /// The original rule string used to build this filter.
        /// </param>
        /// <param name="parts">
        /// The UrlFilterFragment parts that make up this filter.
        /// </param>
        /// <param name="options">
        /// The filter options.
        /// </param>
        /// <param name="applicableDomains">
        /// Domains that the filter should be applied to.
        /// </param>
        /// <param name="exceptionDomains">
        /// Domains that the filter should not be applied to.
        /// </param>
        /// <param name="isException">
        /// Whether or not the filter is an exception, that is to say, a whitelisting filter.
        /// </param>
        /// <param name="categoryId">
        /// The category ID of the category this filter belongs to.
        /// </param>
        internal UrlFilter(string originalRule, List <UrlFilteringRuleFragment> parts, UrlFilterOptions options, List <string> applicableDomains, List <string> exceptionDomains, List <string> applicableReferers, List <string> exceptionReferers, bool isException, short categoryId) : base(originalRule, isException, categoryId)
        {
            Parts   = parts;
            Options = options;

            ApplicableDomains = applicableDomains;
            ExceptionDomains  = exceptionDomains;

            ApplicableReferers = applicableReferers;
            ExceptReferers     = exceptionReferers;
        }