/// <summary> /// Builds the navigation (tree view). /// </summary> private void BindTreeNodes() { #region "Root Node" TreeNode tnDevTools = new TreeNode(); tnDevTools.Name = WinFormStrConstants.NodeNames.NodeDevTools; tnDevTools.Text = WinFormStrConstants.NodeText.NodeDevTools; tnDevTools.ImageIndex = 6; tnDevTools.SelectedImageIndex = 6; #endregion #region "SharePoint" TreeNode tnSharePoint = new TreeNode(); tnSharePoint.Name = WinFormStrConstants.NodeNames.NodeSharePoint; tnSharePoint.Text = WinFormStrConstants.NodeText.NodeSharePoint; tnSharePoint.ImageIndex = 4; tnSharePoint.SelectedImageIndex = 4; TreeNode tnSPList = new TreeNode(); tnSPList.Name = WinFormStrConstants.NodeNames.NodeSharePointList; tnSPList.Text = WinFormStrConstants.NodeText.NodeSharePointList; tnSPList.ToolTipText = WinFormStrConstants.NodeText.NodeSharePointListTool; tnSPList.ImageIndex = 8; tnSPList.SelectedImageIndex = 11; #endregion #region "Windows" TreeNode tnWin = new TreeNode(); tnWin.Name = WinFormStrConstants.NodeNames.NodeWindows; tnWin.Text = WinFormStrConstants.NodeText.NodeWindows; tnWin.ImageIndex = 9; tnWin.SelectedImageIndex = 9; TreeNode tnIISProcesses = new TreeNode(); tnIISProcesses.Name = WinFormStrConstants.NodeNames.NodeIISProcesses; tnIISProcesses.Text = WinFormStrConstants.NodeText.NodeIISProcesses; tnIISProcesses.ToolTipText = WinFormStrConstants.NodeText.NodeIISProcessesTool; tnIISProcesses.ImageIndex = 8; tnIISProcesses.SelectedImageIndex = 11; TreeNode tnFileSplitter = new TreeNode(); tnFileSplitter.Name = WinFormStrConstants.NodeNames.NodeWinServices; tnFileSplitter.Text = WinFormStrConstants.NodeText.NodeWinServices; tnFileSplitter.ToolTipText = WinFormStrConstants.NodeText.NodeWinServicesTool; tnFileSplitter.ImageIndex = 8; tnFileSplitter.SelectedImageIndex = 11; TreeNode tnWinSvcs = new TreeNode(); tnWinSvcs.Name = WinFormStrConstants.NodeNames.NodeFileSplitter; tnWinSvcs.Text = WinFormStrConstants.NodeText.NodeFileSplitter; tnWinSvcs.ToolTipText = WinFormStrConstants.NodeText.NodeFileSplitterTool; tnWinSvcs.ImageIndex = 8; tnWinSvcs.SelectedImageIndex = 11; #endregion // Build the tree // Build level 2 nodes tnSharePoint.Nodes.Add(tnSPList); tnWin.Nodes.Add(tnIISProcesses); tnWin.Nodes.Add(tnWinSvcs); tnWin.Nodes.Add(tnFileSplitter); // Build level 1 nodes tnDevTools.Nodes.Add(tnSharePoint); tnDevTools.Nodes.Add(tnWin); // Add root to the tree TreeNav.Nodes.Add(tnDevTools); TreeNav.ExpandAll(); TreeNav.ShowNodeToolTips = true; string selNodeName = AppSettings.Instance.LastSelectedNodeName; if ((!String.IsNullOrWhiteSpace(selNodeName)) && (this.TreeNav != null)) { // Find the node in the tree TreeNode[] foundNodes = this.TreeNav.Nodes.Find(selNodeName, true); if ((foundNodes != null) && (foundNodes.Length > 0)) { // Select the saved node this.TreeNav.SelectedNode = foundNodes[0]; this.DetermineCurrentControl(this.TreeNav.SelectedNode); } } }
private void SpltCnt_SplitterMoved(object sender, SplitterEventArgs e) { // Take the focus away from the splitter TreeNav.Focus(); }