private void FillTreeView(FMCategoriesCollection tags) { var tv = tags == TagsFilter.AndTags ? AndTreeView : tags == TagsFilter.OrTags ? OrTreeView : NotTreeView; tv.SuspendDrawing(); tv.Nodes.Clear(); ControlUtils.FillTreeViewFromTags_Sorted(tv, tags); tv.ExpandAll(); tv.ResumeDrawing(); CheckTagInAny(); }
internal FilterTagsForm(FMCategoriesCollection sourceTags, TagsFilter tagsFilter) { #if DEBUG InitializeComponent(); #else InitializeComponentSlim(); #endif tagsFilter.DeepCopyTo(TagsFilter); if (Config.DarkMode) { SetThemeBase(Config.VisualTheme); } Localize(); var tv = OriginTreeView; try { tv.BeginUpdate(); ControlUtils.FillTreeViewFromTags_Sorted(tv, sourceTags); tv.ExpandAll(); tv.SelectedNode = tv.Nodes[0]; } finally { tv.EndUpdate(); } if (TagsFilter.AndTags.Count > 0) { FillTreeView(TagsFilter.AndTags); } if (TagsFilter.OrTags.Count > 0) { FillTreeView(TagsFilter.OrTags); } if (TagsFilter.NotTags.Count > 0) { FillTreeView(TagsFilter.NotTags); } }