public AppSettingsTextClassifierContext(SearchMatcher searchMatcher, string text, string tag, bool colorize, IReadOnlyCollection <SpanData <object> > colors = null) : base(text, tag, colorize, colors) { if (searchMatcher == null) { throw new ArgumentNullException(nameof(searchMatcher)); } SearchMatcher = searchMatcher; }
public AppSettingsTreeViewNodeClassifierContext(SearchMatcher searchMatcher, string text, ITreeView treeView, ITreeNodeData node, bool isToolTip, bool colorize, IReadOnlyCollection <SpanData <object> > colors = null) : base(text, treeView, node, isToolTip, colorize, colors) { if (searchMatcher == null) { throw new ArgumentNullException(nameof(searchMatcher)); } SearchMatcher = searchMatcher; }
void FilterChildren(AppSettingsPageVM page, SearchMatcher matcher) { bool atLeastOneChildVisible = false; foreach (var child in page.Children) { FilterChildren(child, matcher); atLeastOneChildVisible |= !child.TreeNode.IsHidden; } bool isVisible = atLeastOneChildVisible || IsVisible(page, matcher); page.TreeNode.IsHidden = !isVisible; if (isVisible) { page.TreeNode.IsExpanded = true; } }
bool IsVisible(AppSettingsPageVM page, SearchMatcher matcher) { matchList.Clear(); var p = page; // Don't include the root while (p.Parent != null) { matchList.Add(p.Page.Title); p = p.Parent; } foreach (var s in page.GetSearchableStrings(appSettingsDlg)) { matchList.Add(s); } bool res = matcher.IsMatchAll(matchList); matchList.Clear(); return(res); }
public AppSettingsTreeViewNodeClassifierContext(SearchMatcher searchMatcher, string text, ITreeView treeView, TreeNodeData node, bool isToolTip, bool colorize, IReadOnlyCollection<SpanData<object>> colors = null) : base(text, treeView, node, isToolTip, colorize, colors) { if (searchMatcher == null) throw new ArgumentNullException(nameof(searchMatcher)); SearchMatcher = searchMatcher; }
public AppSettingsTextClassifierContext(SearchMatcher searchMatcher, string text, string tag, bool colorize, IReadOnlyCollection<SpanData<object>> colors = null) : base(text, tag, colorize, colors) { if (searchMatcher == null) throw new ArgumentNullException(nameof(searchMatcher)); SearchMatcher = searchMatcher; }