private void TreeViewTabControl_Selected(object sender, TabControlEventArgs e) { if (e.TabPage == tagsTabPage) { tagsToolStrip.Filter(); } else { tagsTreeView.TreeView.Nodes.Clear(); } if (e.TabPage == bookmarksTabPage) { bookmarksToolStrip.Filter(); } else { bookmarksTreeView.TreeView.Nodes.Clear(); } if (e.TabPage == libraryTabPage) { libraryModel.Start(); libraryToolStrip.Filter(); libraryModel.EnablePolling(); } else { libraryModel.Stop(); libraryModel.DisablePolling(); libraryTreeView.TreeView.Nodes.Clear(); } if (e.TabPage == browsingTabPage) { browsingToolStrip.Filter(); } else { browsingTreeView.TreeView.Nodes.Clear(); } }