示例#1
0
        /// <summary>
        /// Creates a policy resolver that retrieves policies from the email address.
        /// Policies are resolved against the host portion fo the<see cref="MailAddress"/>.
        /// </summary>
        /// <param name="index">
        /// An index instance providing <see cref="IPolicyIndex"/>
        /// </param>
        /// <param name="cacheSettings">
        /// The cache settings to use. Specify null for no caching.
        /// </param>
        public PolicyResolver(IPolicyIndex index, CacheSettings cacheSettings)
        {
            if (index == null)
            {
                throw new ArgumentNullException("index");
            }

            m_policyIndex = index;

            if (cacheSettings != null && cacheSettings.Cache)
            {
                m_policyCache = new PolicyCache(cacheSettings);
            }
        }
示例#2
0
        /// <summary>
        /// Creates a policy resolver that retrieves policies from the email address. 
        /// Policies are resolved against the host portion fo the<see cref="MailAddress"/>.
        /// </summary>
        /// <param name="index">
        /// An index instance providing <see cref="IPolicyIndex"/>
        /// </param>
        /// <param name="cacheSettings">
        /// The cache settings to use. Specify null for no caching.
        /// </param>
        public PolicyResolver(IPolicyIndex index, CacheSettings cacheSettings)
        {
            if (index == null)
            {
                throw new ArgumentNullException("index");
            }

            m_policyIndex = index;

            if (cacheSettings != null && cacheSettings.Cache)
            {
                m_policyCache = new PolicyCache(cacheSettings); 
            }
        }