private void _optionsTree_AfterSelect(object sender, TreeViewEventArgs e) { foreach (BasePanel panel in _panelCollection.Values) { panel.Visible = false; } _screenPanel.Visible = false; _formatPricePanel.Visible = false; _serviceDetailsPanel.Visible = false; TreeNode node = (sender as TreeView).SelectedNode; if (_panelCollection.ContainsKey(node.Name)) { _panelCollection[node.Name].Visible = true; } else if (node.Parent.Name == "PricesNode") { _formatPricePanel.Visible = true; _formatPricePanel.SetProduct(_priceManager.GetProduct(node.Name), node.Text); } else if (node.Parent.Name == "ServicesNode") { _serviceDetailsPanel.Visible = true; _serviceDetailsPanel.SetService(_priceManager.GetService(node.Name)); } else if (node.Parent.Name == "AppearanceNode") { _screenPanel.Visible = true; _screenPanel.SetScreen(_config.GetScreen(node.Name)); } }