public void SyncFilters() { // get a list of all standard Direct Show Filter Categories List <DsDevice> categories = new List <DsDevice>(DirectShowLib.DsDevice.GetDevicesOfCat(FilterCategory.ActiveMovieCategories)); // find tree nodes that haven't been created for a category yet foreach (DsDevice dev in categories) { if (GetParentNodeByName(dev.Name) == null) { // create the IDSFilterCollection for this category TreeNode tn = new TreeNode(dev.Name); tn.Tag = new StandardFilterCategory(dev); Nodes.Add(tn); } } this.BeginUpdate(); foreach (TreeNode tn in Nodes) { IDSFilterCollection categoryCollection = (IDSFilterCollection)tn.Tag; // sync the filters in the filter collection with the tree view categoryCollection.SyncTreeNodes(tn.Nodes); } Sort(); this.EndUpdate(); }
public void AddCategory(IDSFilterCollection categoryCollection) { // create a parent node for the filter collection TreeNode tn = new TreeNode(categoryCollection.CategoryName); tn.Tag = categoryCollection; Nodes.Add(tn); }