예제 #1
0
        /// <summary>
        /// Add or change a filter set
        /// </summary>
        public static void SetFilterSet <T>(DocumentFilterSet <T> filterSet)
        {
            if (filterSet == null)
            {
                throw new ArgumentNullException("filterSet");
            }

            lock (Filters)
            {
                Filters[typeof(T)] = filterSet;
            }
        }
예제 #2
0
        /// <summary>
        /// Add or change filter, replacing the entire filter set if present
        /// </summary>
        public static void SetFilter <T>(IDocumentFilter <T> filter)
        {
            if (filter == null)
            {
                throw new ArgumentNullException("filter");
            }

            lock (Filters)
            {
                Filters[typeof(T)] = new DocumentFilterSet <T>(filter);
            }
        }