Пример #1
0
        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();
        }
Пример #2
0
        protected override void LoadChildNodes(TmpltTreeNodeType NodeFilterType)
        {
            if (((SnipXmlElement)Element).GetPartsElement() == null)
            {
                return;
            }

            foreach (SnipPartXmlElement snipPart in ((SnipXmlElement)Element).GetPartsElement().ChildNodes)
            {
                AddElementNode(snipPart, NodeFilterType);
            }
        }
Пример #3
0
 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);
         }
     }
 }
Пример #4
0
        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);
        }
Пример #5
0
 /// <summary>
 /// 加载子节点
 /// </summary>
 protected abstract void LoadChildNodes(TmpltTreeNodeType NodeFilterType);
Пример #6
0
 /// <summary>
 /// 加载节点本身的数据。若需要加载子节点,则在派生类的实现里需要调用LoadChildNodes()
 /// </summary>
 public abstract void LoadData(TmpltTreeNodeType NodeFilterType);
Пример #7
0
 public override void LoadData(TmpltTreeNodeType NodeFilterType)
 {
     LoadChildNodes(NodeFilterType);
 }
Пример #8
0
 public override void LoadData(TmpltTreeNodeType NodeFilterType)
 {
     this.Text        = ((SnipXmlElement)Element).SnipName;
     this.ToolTipText = ((SnipXmlElement)Element).SnipType.ToString();
     LoadChildNodes(NodeFilterType);
 }
Пример #9
0
        /// <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);
        }
Пример #10
0
 protected override void LoadChildNodes(TmpltTreeNodeType NodeFilterType)
 {
 }
Пример #11
0
 public override void LoadData(TmpltTreeNodeType NodeFilterType)
 {
 }