public override void SetContext(Control owner, HttpContext context, IQueryableDataSource dataSource)
        {
            base.SetContext(owner, context, dataSource);

            FilterExpressionProvider = FindControl(Owner);
            FilterExpressionProvider.Initialize(dataSource);
        }
        /// <summary>
        /// Initializes the <see cref="FilterExpressionProviderFactory"/> class.
        /// </summary>
        static FilterExpressionProviderFactory()
        {
            DefaultProvider = new DefaultFilterExpressionProvider();

            ExpressionProviders = new Dictionary <Type, IFilterExpressionProvider>
            {
                { typeof(DateInterval), new DateIntervalFilterExpressionProvider() },
            };
        }
        /// <summary>
        /// Removes a FilterExpressionProvider from the FilterEvaluator.
        /// </summary>
        /// <param name="provider">
        /// The provider to remove.
        /// </param>
        public void RemoveFilterExpressionProvider(IFilterExpressionProvider provider)
        {
            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }

            this.filterExpressionProviders.Remove(provider);
            provider.FilterExpressionChanged -= this.FilterProvider_FilterExpressionChanged;
        }
Exemple #4
0
        /// <summary>
        /// Adds a FilterExpressionProvider to the FilterEvaluator.
        /// </summary>
        /// <param name="provider">
        /// The provider to add.
        /// </param>
        public void AddFilterExpressionProvider(IFilterExpressionProvider provider)
        {
            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }

            this.filterExpressionProviders.Add(provider);
            provider.FilterExpressionChanged += new EventHandler(this.FilterProvider_FilterExpressionChanged);
        }
Exemple #5
0
        /// <summary>
        /// Removes a FilterExpressionProvider from the FilterEvaluator.
        /// </summary>
        /// <param name="provider">
        /// The provider to remove.
        /// </param>
        public void RemoveFilterExpressionProvider(IFilterExpressionProvider provider)
        {
            if (null == provider)
            {
                throw new ArgumentNullException("provider");
            }

            this.filterExpressionProviders.Remove(provider);
            provider.FilterExpressionChanged -= new EventHandler(this.FilterProvider_FilterExpressionChanged);
        }
Exemple #6
0
        /// <summary>
        /// Removes a FilterExpressionProvider from the FilterEvaluator.
        /// </summary>
        /// <param name="provider">
        /// The provider to remove.
        /// </param>
        public void RemoveFilterExpressionProvider(IFilterExpressionProvider provider)
        {
            if (null == provider)
            {
                throw new ArgumentNullException("provider");
            }

            this.filterExpressionProviders.Remove(provider);
            provider.FilterExpressionChanged -= new EventHandler(this.FilterProvider_FilterExpressionChanged);
        }
        public override void SetContext(Control owner, HttpContext context, IQueryableDataSource dataSource) {
            base.SetContext(owner, context, dataSource);            

            FilterExpressionProvider = FindControl(Owner);            
            FilterExpressionProvider.Initialize(dataSource);
        }