private void NodesTreeView_AfterSelect(object sender, TreeViewEventArgs treeViewArgs) { IAdminObject adminObject = treeViewArgs.Node.Tag as IAdminObject; if (null == adminObject) { MessageBox.Show("Admin node was incorrectly initialized"); } else { viewPanel.Controls.Clear(); adminObject.Show(viewPanel); } }
public void UpdateAllViews() { foreach (TreeNode treeNode in nodesTreeView.Nodes) { IAdminObject adminObject = ( IAdminObject )treeNode.Tag; try { adminObject.Show(viewPanel); } catch (Exception e) { MessageBox.Show(string.Format("There was an exception updating: {0}\n\n{1}", adminObject.GetNodeText(), e.ToString())); } } }