Example #1
0
        protected void RefreshTree()
        {
            List <RsCollectionFolder> lFolders = CollectionProvider.RootFolder.GetSubFolders();

            foreach (RsCollectionFolder iFolder in lFolders)
            {
                RsCollectionTreeNode.CreateNode(iFolder, null, this);
            }
        }
        public static RsCollectionTreeNode CreateNode(
            RsCollectionItem aItem,
            RsCollectionTreeNode aParentNode,
            RsCollectionTree aOwner
            )
        {
            RsCollectionTreeNode lResult = new RsCollectionTreeNode();

            lResult.IntegrateNode(aItem, aParentNode, aOwner);
            return(lResult);
        }
        public void AddChild(string aChildName)
        {
            Expand();

            if (CollectionItem is RsCollectionFolder)
            {
                RsCollectionFolder lFolder =
                    ((RsCollectionFolder)CollectionItem).AddSubFolder(
                        ((RsCollectionFolder)CollectionItem).GetNextName(aChildName)
                        );

                RsCollectionTreeNode lNode = RsCollectionTreeNode.CreateNode(lFolder, this, Owner);
                lNode.DeleteOnCancel = true;
                lNode.Editing        = true;
            }
        }
        protected void ehSelectNode(RsCollectionTree aSender, RsCollectionTreeNode aNode)
        {
            if (ItemList.Items != null)
                ItemList.Items.Clear();

            if (aNode != null && aNode.CollectionItem is RsCollectionFolder)
            {
                RsCollectionFolder lFolder = aNode.CollectionItem as RsCollectionFolder;

                List<RsCollectionItem> lItems = lFolder.GetSubItems();
                foreach (RsCollectionItem iItem in lItems)
                {
                    ItemList.Items.Add(new RsListViewItem(iItem));
                }
            }
        }
        protected void ehNodeSelected(RsCollectionTree aSender, RsCollectionTreeNode aNode)
        {
            foreach (Control iCtl in this.Controls)
            {
                if (iCtl is RsCollectionTree && iCtl != aSender)
                {
                    ((RsCollectionTree)iCtl).DeselectNode();
                }
            }

            this.SelectedCollectionNode = aNode;

            if (CollectionNodeSelected != null)
            {
                CollectionNodeSelected(aSender, aNode);
            }
        }
        public void IntegrateNode(
            RsCollectionItem aItem,
            RsCollectionTreeNode aParentNode,
            RsCollectionTree aOwner
            )
        {
            ParentNode     = aParentNode;
            Owner          = aOwner;
            CollectionItem = aItem;

            if (ParentNode != null)
            {
                ParentNode.Children.Add(this);
            }

            Owner.AddNode(this);
        }
Example #7
0
        public void AddNode(RsCollectionTreeNode aNode)
        {
            aNode.ContextMenu = FolderContext;

            if (Locale != null)
            {
                Locale.AddLocalizedControl(aNode);
            }

            if (aNode.ParentNode == null)
            {
                this.RootNodes.Add(aNode);
            }

            this.Controls.Add(aNode);

            SortNodes();
        }
Example #8
0
        protected void ehSelectNode(RsCollectionTree aSender, RsCollectionTreeNode aNode)
        {
            if (ItemList.Items != null)
            {
                ItemList.Items.Clear();
            }

            if (aNode != null && aNode.CollectionItem is RsCollectionFolder)
            {
                RsCollectionFolder lFolder = aNode.CollectionItem as RsCollectionFolder;

                List <RsCollectionItem> lItems = lFolder.GetSubItems();
                foreach (RsCollectionItem iItem in lItems)
                {
                    ItemList.Items.Add(new RsListViewItem(iItem));
                }
            }
        }
        public void Expand()
        {
            if (Expanded)
            {
                return;
            }
            Children = new List <RsCollectionTreeNode>();

            if (CollectionItem is RsCollectionFolder)
            {
                RsCollectionFolder        lFolder   = (RsCollectionFolder)CollectionItem;
                List <RsCollectionFolder> lChildren = lFolder.GetSubFolders();

                foreach (RsCollectionItem iItem in lChildren)
                {
                    RsCollectionTreeNode.CreateNode(iItem, this, Owner);
                }
            }

            Expanded = true;
        }
Example #10
0
        protected int SortNodes(RsCollectionTreeNode aNode, int aTop)
        {
            int lOffset = 0;

            if (aNode != null && aNode.Children != null)
            {
                foreach (RsCollectionTreeNode iNode in aNode.Children)
                {
                    iNode.Location = new Point(this.BodyLeft, aTop + lOffset);
                    iNode.Size     = new Size(this.BodyWidth, iNode.Editing ? 2 * NodeHeight : NodeHeight);
                    iNode.TabIndex = CurrentNodeTabIndex;
                    CurrentNodeTabIndex++;
                    lOffset += iNode.Height;

                    if (iNode.HasChildNodes())
                    {
                        lOffset += SortNodes(iNode, aTop + lOffset);
                    }
                }
            }

            return(lOffset);
        }
        protected void ehNodeSelected(RsCollectionTree aSender, RsCollectionTreeNode aNode)
        {
            foreach (Control iCtl in this.Controls) {
                            if (iCtl is RsCollectionTree && iCtl != aSender) {
                                    ((RsCollectionTree)iCtl).DeselectNode();
                                }
                        }

                    this.SelectedCollectionNode = aNode;

                    if (CollectionNodeSelected != null)
                            CollectionNodeSelected(aSender, aNode);
        }
        public void IntegrateNode(
            RsCollectionItem aItem,
            RsCollectionTreeNode aParentNode,
            RsCollectionTree aOwner
            )
        {
            ParentNode = aParentNode;
                        Owner = aOwner;
                        CollectionItem = aItem;

                        if (ParentNode != null)
                                ParentNode.Children.Add(this);

                        Owner.AddNode(this);
        }
 public static RsCollectionTreeNode CreateNode(
     RsCollectionItem aItem,
     RsCollectionTreeNode aParentNode,
     RsCollectionTree aOwner
     )
 {
     RsCollectionTreeNode lResult = new RsCollectionTreeNode();
                 lResult.IntegrateNode(aItem, aParentNode, aOwner);
                 return lResult;
 }
Example #14
0
        public void AddNode(RsCollectionTreeNode aNode)
        {
            aNode.ContextMenu = FolderContext;

                    if (Locale != null)
                            Locale.AddLocalizedControl(aNode);

                    if (aNode.ParentNode == null)
                            this.RootNodes.Add(aNode);

                    this.Controls.Add(aNode);

                    SortNodes();
        }
Example #15
0
 public void RemoveNode(RsCollectionTreeNode aNode)
 {
     this.RootNodes.Remove(aNode);
             this.Controls.Remove(aNode);
             SortNodes();
 }
Example #16
0
 internal void DeselectNode()
 {
     InvalidateSelectedNode();
             selectedNode = null;
             InvalidateSelectedNode();
 }
Example #17
0
 public void RemoveNode(RsCollectionTreeNode aNode)
 {
     this.RootNodes.Remove(aNode);
     this.Controls.Remove(aNode);
     SortNodes();
 }
Example #18
0
        protected int SortNodes(RsCollectionTreeNode aNode, int aTop)
        {
            int lOffset = 0;

                    if (aNode != null && aNode.Children != null)
                            foreach (RsCollectionTreeNode iNode in aNode.Children) {
                                    iNode.Location = new Point(this.BodyLeft, aTop + lOffset);
                                    iNode.Size = new Size(this.BodyWidth, iNode.Editing ? 2*NodeHeight : NodeHeight);
                                    iNode.TabIndex = CurrentNodeTabIndex;
                                    CurrentNodeTabIndex++;
                                    lOffset += iNode.Height;

                                    if (iNode.HasChildNodes()) {
                                            lOffset += SortNodes(iNode, aTop + lOffset);
                                        }
                                }

                    return lOffset;
        }
Example #19
0
 internal void DeselectNode()
 {
     InvalidateSelectedNode();
     selectedNode = null;
     InvalidateSelectedNode();
 }