public void OnRemoveCategoryNode(TreeNodeX node)
 {
     if (NextLevelLoaded)
     {
         List <TreeNodePointer> list = new List <TreeNodePointer>();
         for (int i = 0; i < Nodes.Count; i++)
         {
             TreeNodeX tnx = Nodes[i] as TreeNodeX;
             if (tnx != null)
             {
                 TreeNodePointer tnp = tnx as TreeNodePointer;
                 if (tnp != null && tnp.TreeNodeId == node.TreeNodeId)
                 {
                     list.Add(tnp);
                 }
                 else
                 {
                     tnx.OnRemoveCategoryNode(node);
                 }
             }
         }
         foreach (TreeNodePointer p in list)
         {
             p.Remove();
         }
     }
 }
Beispiel #2
0
 public override bool SetReferencedNode(TreeNodePointer node)
 {
     if (this.TreeNodeId == node.TreeNodeId)
     {
         if (this._dataNode != null)
         {
             node.SetReferenceNode(_dataNode);
             return(true);
         }
     }
     else
     {
         if (NextLevelLoaded)
         {
             for (int i = 0; i < Nodes.Count; i++)
             {
                 TreeNodeX tnx = Nodes[i] as TreeNodeX;
                 if (tnx != null)
                 {
                     if (tnx.SetReferencedNode(node))
                     {
                         return(true);
                     }
                 }
             }
         }
     }
     return(false);
 }
        public TreeNode CreatePointer()
        {
            TreeNodePointer obj = new TreeNodePointer(_xmlNode);

            if (this.IsShortcut)
            {
                bool      loaded = false;
                TreeViewX tvx    = this.TreeView as TreeViewX;
                if (tvx != null)
                {
                    TreeNodeX tnx = tvx.GetCategoryNodeById(this.TreeNodeId);
                    if (tnx != null)
                    {
                        VPLUtil.CopyProperties(tnx, obj);
                        loaded = true;
                    }
                }
                if (!loaded)
                {
                    ObjectXmlReader oxr = new ObjectXmlReader();
                    oxr.ReadProperties(_xmlNode, obj);
                }
            }
            else
            {
                VPLUtil.CopyProperties(this, obj);
            }
            return(obj);
        }