protected override void LoadChildNodes(TmpltTreeNodeType NodeFilterType) { this.Nodes.Clear(); TmpltXmlDocument tmpltDoc = Service.Sdsite.CurrentDocument.GetTmpltDocumentById(ID); foreach (SnipXmlElement snipEle in tmpltDoc.GetSnipElementList()) { AddElementNode(snipEle, NodeFilterType); } SetNoChildNodesText(); }
protected override void LoadChildNodes(TmpltTreeNodeType NodeFilterType) { if (((SnipXmlElement)Element).GetPartsElement() == null) { return; } foreach (SnipPartXmlElement snipPart in ((SnipXmlElement)Element).GetPartsElement().ChildNodes) { AddElementNode(snipPart, NodeFilterType); } }
protected override void LoadChildNodes(TmpltTreeNodeType NodeFilterType) {//Part if (((SnipPartXmlElement)Element).ChildNodes == null) { return; } foreach (XmlNode node in ((SnipPartXmlElement)Element).ChildNodes) { if (node.Name == "part") { SnipPartXmlElement snipPart = node as SnipPartXmlElement; AddElementNode(snipPart, NodeFilterType); } } }
public virtual void AddElementNode(AnyXmlElement Element, TmpltTreeNodeType NodeFilterType) { TmpltBaseTreeNode tmpltBase = null; if (Element is SnipXmlElement) { tmpltBase = new SnipElementNode(Element as SnipXmlElement); if ((NodeFilterType != TmpltTreeNodeType.none) && NodeFilterType != tmpltBase.CurrentNodeType) { return; } } else if (Element is SnipPartXmlElement) { tmpltBase = new PartElementNode(Element as SnipPartXmlElement); } AddChildNode(tmpltBase); tmpltBase.LoadData(NodeFilterType); }
/// <summary> /// 加载子节点 /// </summary> protected abstract void LoadChildNodes(TmpltTreeNodeType NodeFilterType);
/// <summary> /// 加载节点本身的数据。若需要加载子节点,则在派生类的实现里需要调用LoadChildNodes() /// </summary> public abstract void LoadData(TmpltTreeNodeType NodeFilterType);
public override void LoadData(TmpltTreeNodeType NodeFilterType) { LoadChildNodes(NodeFilterType); }
public override void LoadData(TmpltTreeNodeType NodeFilterType) { this.Text = ((SnipXmlElement)Element).SnipName; this.ToolTipText = ((SnipXmlElement)Element).SnipType.ToString(); LoadChildNodes(NodeFilterType); }
/// <summary> /// 过滤 事件的相应 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FilterToolStripMenuItem_Click(object sender, EventArgs e) { ToolStripMenuItem menuItem = (ToolStripMenuItem)(sender); TmpltTreeNodeType TmpltFilter = _myTree.TmpltFilter; TmpltTreeNodeType SnipFilter = _myTree.SnipFilter; switch (menuItem.Name) { #region 模板过滤部分 case "allTmplt": TmpltFilter = TmpltTreeNodeType.none; break; case "generalTmpltMenuItem": TmpltFilter = TmpltTreeNodeType.generalTmplt; break; case "homeTmpltMenuItem": TmpltFilter = TmpltTreeNodeType.homeTmplt; break; case "productTmpltMenuItem": TmpltFilter = TmpltTreeNodeType.productTmplt; break; case "knowledgeTmpltMenuItem": TmpltFilter = TmpltTreeNodeType.knowledgeTmplt; break; case "hrTmpltMenuItem": TmpltFilter = TmpltTreeNodeType.hrTmplt; break; case "inviteBidTmpltMenuItem": TmpltFilter = TmpltTreeNodeType.inviteBidTmplt; break; case "projectTmpltMenuItem": TmpltFilter = TmpltTreeNodeType.projectTmplt; break; #endregion #region 页面过滤部分 case "allSnip": SnipFilter = TmpltTreeNodeType.none; break; case "generalSnip": SnipFilter = TmpltTreeNodeType.snipGeneral; break; case "contentSnip": SnipFilter = TmpltTreeNodeType.snipContent; break; #endregion } //按过滤的显示 _myTree.TmpltFilter = TmpltFilter; _myTree.SnipFilter = SnipFilter; string[] openItem = _myTree.OpenItems; _myTree.BeginUpdate(); _myTree.UnloadTreeData(); _myTree.LoadTreeData(); _myTree.OpenItems = openItem; _myTree.EndUpdate(); //toopstrip变化 相应到状态栏上 _myStatusStrip.UpdateStatusStripInfo(); SetMenuItemMutex(menuItem); }
protected override void LoadChildNodes(TmpltTreeNodeType NodeFilterType) { }
public override void LoadData(TmpltTreeNodeType NodeFilterType) { }