/// <summary> /// eventhandler after select /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void treeNavigation_AfterSelect(object sender, TreeViewEventArgs e) { this.txtPath.Text = e.Node.FullPath; this.pnlMain.Controls.Remove(this._currentModule); if (e.Node.Tag is ModuleBase) { ModuleBase module = e.Node.Tag as ModuleBase; this._currentModule = module; this._currentModule.Height = this.lvModules.Height; this._currentModule.Width = this.lvModules.Width; this._currentModule.Top = this.lvModules.Top; this._currentModule.Left = this.lvModules.Left; this._currentModule.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top; this.pnlMain.Controls.Add(module); module.BringToFront(); module.RefreshData(); } else { this.lvModules.Items.Clear(); foreach (TreeNode moduleNode in e.Node.Nodes) { ModuleBase module = moduleNode.Tag as ModuleBase; ListViewItem item = this.lvModules.Items.Add(module.Name, moduleNode.ImageIndex); item.SubItems.Add(module.Description); item.Tag = moduleNode; } } }