Пример #1
0
        protected void RefreshTree()
        {
            List <RsCollectionFolder> lFolders = CollectionProvider.RootFolder.GetSubFolders();

            foreach (RsCollectionFolder iFolder in lFolders)
            {
                RsCollectionTreeNode.CreateNode(iFolder, null, this);
            }
        }
Пример #2
0
        public static RsCollectionTreeNode CreateNode(
            RsCollectionItem aItem,
            RsCollectionTreeNode aParentNode,
            RsCollectionTree aOwner
            )
        {
            RsCollectionTreeNode lResult = new RsCollectionTreeNode();

            lResult.IntegrateNode(aItem, aParentNode, aOwner);
            return(lResult);
        }
Пример #3
0
        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));
                }
            }
        }
Пример #5
0
        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);
            }
        }
Пример #6
0
        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);
        }
Пример #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();
        }
Пример #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));
                }
            }
        }
Пример #9
0
        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;
        }
Пример #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);
        }
Пример #11
0
        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);
        }
Пример #12
0
        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);
        }
Пример #13
0
 public static RsCollectionTreeNode CreateNode(
     RsCollectionItem aItem,
     RsCollectionTreeNode aParentNode,
     RsCollectionTree aOwner
     )
 {
     RsCollectionTreeNode lResult = new RsCollectionTreeNode();
                 lResult.IntegrateNode(aItem, aParentNode, aOwner);
                 return lResult;
 }
Пример #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();
        }
Пример #15
0
 public void RemoveNode(RsCollectionTreeNode aNode)
 {
     this.RootNodes.Remove(aNode);
             this.Controls.Remove(aNode);
             SortNodes();
 }
Пример #16
0
 internal void DeselectNode()
 {
     InvalidateSelectedNode();
             selectedNode = null;
             InvalidateSelectedNode();
 }
Пример #17
0
 public void RemoveNode(RsCollectionTreeNode aNode)
 {
     this.RootNodes.Remove(aNode);
     this.Controls.Remove(aNode);
     SortNodes();
 }
Пример #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;
        }
Пример #19
0
 internal void DeselectNode()
 {
     InvalidateSelectedNode();
     selectedNode = null;
     InvalidateSelectedNode();
 }