private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
        {
            var textBox = (TextBox)sender;
            var text = textBox.Text;
            int threshold;

            Filter = !int.TryParse(text, out threshold) ? null : new ContentFilter(threshold);
        }
Exemple #2
0
 string Enclose(IContentFilter exp)
 {
     if (exp is OrFilter)
     {
         return($"({exp})");
     }
     return(exp.ToString());
 }
        private void Filter_Changed(object newValue)
        {
            // Update the effective filter. If the filter is provided as content, the content filter will be recreated when needed.
            _activeFilter = newValue as IContentFilter;

            // Notify the filter to update the view.
            FilterHost?.OnFilterChanged();
        }
Exemple #4
0
        public IReadOnlyList <string> Process(string content, IContentFilter source)
        {
            var ws = new WordSplitter(content);

            var words = ws.Split();

            //return words;
            return(source.Filter(words));
        }
 protected SitemapXmlGenerator(ISitemapRepository sitemapRepository, IContentRepository contentRepository, UrlResolver urlResolver, ISiteDefinitionRepository siteDefinitionRepository, ILanguageBranchRepository languageBranchRepository,
                               IContentFilter contentFilter)
 {
     this.SitemapRepository        = sitemapRepository;
     this.ContentRepository        = contentRepository;
     this.UrlResolver              = urlResolver;
     this.SiteDefinitionRepository = siteDefinitionRepository;
     this.LanguageBranchRepository = languageBranchRepository;
     this.EnabledLanguages         = this.LanguageBranchRepository.ListEnabled();
     this.UrlSet        = new HashSet <string>();
     this.ContentFilter = contentFilter;
 }
        /// <summary>
        /// Returns true if the given item matches the filter condition for this column.
        /// </summary>
        internal bool Matches(object item)
        {
            if ((Filter == null) || (FilterHost == null))
            {
                return(true);
            }

            if (_activeFilter == null)
            {
                _activeFilter = FilterHost.CreateContentFilter(Filter);
            }

            return(_activeFilter.IsMatch(GetCellContent(item)));
        }
 private void FlagsValue_Changed()
 {
     Filter = FlagsValue.HasValue ? new ContentFilter(FlagsValue, true) : null;
 }
 public void Add(IContentFilter filter)
 {
     _filters.Add(filter);
 }
 protected BinaryFilterBase(ContentFilterType type, IContentFilter left, IContentFilter right)
 {
     Left  = left ?? throw new ArgumentNullException(nameof(left));
     Right = right ?? throw new ArgumentNullException(nameof(right));
     Type  = type;
 }
Exemple #10
0
 public OrFilter(IContentFilter left, IContentFilter right)
     : base(ContentFilterType.Or, left, right)
 {
 }
Exemple #11
0
 public void AddAt(int index, IContentFilter filter)
 {
     _filters.Insert(index, filter);
 }
Exemple #12
0
 public CommerceSitemapXmlGenerator(ISitemapRepository sitemapRepository, IContentRepository contentRepository, UrlResolver urlResolver, ISiteDefinitionRepository siteDefinitionRepository, ILanguageBranchRepository languageBranchRepository, ReferenceConverter referenceConverter, IContentFilter contentFilter, IContentLoader contentLoader) : base(sitemapRepository, contentRepository, urlResolver, siteDefinitionRepository, languageBranchRepository, contentFilter, contentLoader)
 {
     if (referenceConverter == null)
     {
         throw new ArgumentNullException("referenceConverter");
     }
     _referenceConverter = referenceConverter;
 }
Exemple #13
0
 public AndFilter(IContentFilter left, IContentFilter right)
     : base(ContentFilterType.And, left, right)
 {
 }
 public ContentSchemaRule(string name, IContentFilter filter)
 {
     Name   = name ?? throw new ArgumentNullException(nameof(name));
     Filter = filter ?? throw new ArgumentNullException(nameof(filter));
 }
Exemple #15
0
 public static void SetFilter(DependencyObject o, IContentFilter value) => o.SetValue(FilterProperty, value);
 private void ProtocolValue_Changed()
 {
     Filter = ProtocolValue.HasValue ? new ContentFilter(ProtocolValue, false) : null;
 }
 public RenderStrategy(ITemplateEngine templateEngine, IMarkupLanguage markupLanguage, IContentFilter contentFilter)
 {
     this.templateEngine = templateEngine;
     this.markupLanguage = markupLanguage;
     this.contentFilter  = contentFilter;
 }
Exemple #18
0
 public CommerceAndStandardSitemapXmlGenerator(ISitemapRepository sitemapRepository, IContentRepository contentRepository, UrlResolver urlResolver, ISiteDefinitionRepository siteDefinitionRepository, ILanguageBranchRepository languageBranchRepository, ReferenceConverter referenceConverter, IContentFilter contentFilter, IContentLoader contentLoader)
     : base(sitemapRepository, contentRepository, urlResolver, siteDefinitionRepository, languageBranchRepository, referenceConverter, contentFilter, contentLoader)
 {
 }
Exemple #19
0
 public Splitter(IContentFilter contentFilter)
 {
     this.contentFilter = contentFilter;
 }
        private void Filter_Changed(object newValue)
        {
            // Update the effective filter. If the filter is provided as content, the content filter will be recreated when needed.
            _activeFilter = newValue as IContentFilter;

            // Notify the filter to update the view.
            FilterHost?.OnFilterChanged();
        }
        /// <summary>
        /// Returns true if the given item matches the filter condition for this column.
        /// </summary>
        internal bool Matches(object item)
        {
            if ((Filter == null) || (FilterHost == null))
                return true;

            if (_activeFilter == null)
            {
                _activeFilter = FilterHost.CreateContentFilter(Filter);
            }

            return _activeFilter.IsMatch(GetCellContent(item));
        }
 public XElementFilterModification(IContentFilter filter)
 {
     _filter = filter;
 }
Exemple #23
0
 public MobileSitemapXmlGenerator(ISitemapRepository sitemapRepository, IContentRepository contentRepository, UrlResolver urlResolver, ISiteDefinitionRepository siteDefinitionRepository, ILanguageBranchRepository languageBranchRepository, IContentFilter contentFilter, IContentLoader contentLoader) : base(sitemapRepository, contentRepository, urlResolver, siteDefinitionRepository, languageBranchRepository, contentFilter, contentLoader)
 {
 }
 public ContainsWhereFilter(IContentExpression list, IContentFilter item)
 {
     List       = list ?? throw new ArgumentNullException(nameof(list));
     ItemFilter = item ?? throw new ArgumentNullException(nameof(item));
 }