public NewHomePageForm(FolderXmlElement parentEle, PageType pageType) { InitializeComponent(); this.Text = "新建索引页面"; // 初始化树:只加入频道 _parentEle = parentEle; m_tree = new MyTreeView(); m_tree.TreeMode = TreeMode.SelectTmplt; m_tree.SelectTmpltType = pageType; m_tree.LoadTreeData(); m_tree.HideSelection = false; m_tree.Dock = DockStyle.Fill; TreePanel.Controls.Add(m_tree); if (parentEle == null) { parentEle = (FolderXmlElement)((ElementNode)m_tree.SelectTreeRootChanNode).Element; } NameTextBox.Text = XmlUtilService.CreateIncreasePageTitle(parentEle, PageType.Home); OKBtn.Enabled = false; m_tree.AfterSelect += new TreeViewEventHandler(m_tree_AfterSelect); }
void MyTreeToolStrip_ItemClicked(object sender, ToolStripItemClickedEventArgs e) { switch (e.ClickedItem.Name) { case "ChildNodes": { break; } case "ShowAll": { ToolStripMenuItem tsm = ((ToolStripMenuItem)e.ClickedItem); if (tsm.CheckState == CheckState.Checked) { tsm.CheckState = CheckState.Unchecked; _myTree.ShowAllFiles = false; UnShowAllFile(); } else if (tsm.CheckState == CheckState.Unchecked) { tsm.CheckState = CheckState.Checked; _myTree.ShowAllFiles = true; ShowAllFile(); } break; } case "Refresh": { string[] openItem = _myTree.OpenItems; _myTree.BeginUpdate(); _myTree.UnloadTreeData(); _myTree.LoadTreeData(); _myTree.OpenItems = openItem; _myTree.EndUpdate(); break; } case "CollapseAll": { _myTree.CollapseAll(); break; } case "ExpandAll": { TreeNode nextVisibleNode = _myTree.Nodes[0]; while (nextVisibleNode != null) { TreeNode tempNode = nextVisibleNode; nextVisibleNode = nextVisibleNode.NextVisibleNode; tempNode.Expand(); } break; } } }
/// <summary> /// 初始状态下的TreeView Lisuye /// </summary> private void ShowTreeView() { chanTree = new MyTreeView(); chanTree.TreeMode = TreeMode.SelectChannel; chanTree.LoadTreeData(); chanTree.CurrentNode = chanTree.SelectTreeRootChanNode; chanTree.Dock = DockStyle.Fill; this.TreePanel.Controls.Add(chanTree); }
public SelectTmpltForm(PageType pageType) { InitializeComponent(); newTree = new MyTreeView(); newTree.TreeMode = TreeMode.SelectTmplt; newTree.SelectTmpltType = pageType; newTree.LoadTreeData(); newTree.Dock = DockStyle.Fill; tableLayoutPanel.Controls.Add(newTree); newTree.HideSelection = false; newTree.AfterSelect += new TreeViewEventHandler(newTree_AfterSelect); newTree.DoubleClick += new EventHandler(newTree_DoubleClick); }
public CopyTmpltOherTypeForm(TmpltSimpleExXmlElement tmpltEle) { InitializeComponent(); copyEle = tmpltEle; m_tree = new MyTreeView(); m_tree.TreeMode = TreeMode.SelectTmpltFolder; m_tree.LoadTreeData(); m_tree.HideSelection = false; m_tree.Dock = DockStyle.Fill; TreePanel.Controls.Add(m_tree); NameLab.Text = "命名为:"; m_tree.AfterSelect += new TreeViewEventHandler(m_tree_AfterSelect); }
public NewPageForm(FolderXmlElement parentEle, PageType pageType) { PageType = pageType; InitializeComponent(); Label label1 = new Label(); label1.AutoSize = true; label1.Location = new Point(24, 6); label1.Name = "label1"; label1.Size = new System.Drawing.Size(41, 12); label1.TabIndex = 0; panel3.Controls.Add(label1); // 初始化树:只加入频道 _parentEle = parentEle; m_tree = new MyTreeView(); m_tree.MultiSelect = true; m_tree.TreeMode = TreeMode.SelectTmplt; m_tree.SelectTmpltType = PageType; m_tree.LoadTreeData(); m_tree.HideSelection = false; if (parentEle != null) { TreeNode parentNode = GetFirstTmpltNode(); if (parentNode != null && parentNode.Nodes.Count > 0) { m_tree.CurrentNode = (BaseTreeNode)parentNode.Nodes[0]; } } m_tree.Dock = DockStyle.Fill; m_tree.ExpandAll(); TreePanel.Controls.Add(m_tree); label1.Text = "新建一个页面,请选择一个将要关联的模板!!"; if (parentEle == null) { parentEle = (FolderXmlElement)((ElementNode)m_tree.SelectTreeRootChanNode).Element; } NameTextBox.Text = XmlUtilService.CreateIncreasePageTitle(parentEle, pageType); OKBtn.Enabled = false; m_tree.SelectedNodesChanged += new EventHandler(m_tree_SelectedNodesChanged); }
/// <summary> /// 初始化网站数据,置入Tree中展示 /// </summary> public void LoadTreeData() { _myTree.LoadTreeData(); _toolStrip.SetVisualForInitTree(); }