Exemplo n.º 1
0
        private RadTreeNode InnerGetNodeByName(RadTreeNodeCollection nodes, string name)
        {
            RadTreeNode node = null;

            if (nodes != null && nodes.Count > 0)
            {
                foreach (RadTreeNode nd in nodes)
                {
                    if (nd.Name == name)
                    {
                        node = nd;
                        break;
                    }
                    else if (nd.Nodes.Count > 0)
                    {
                        node = InnerGetNodeByName(nd.Nodes, name);
                        if (node != null)
                        {
                            break;
                        }
                        else
                        {
                            continue;
                        }
                    }
                }
            }
            return(node);
        }
Exemplo n.º 2
0
    private void GetFileList(string directory, RadTreeNodeCollection collection)
    {
        if (directory != string.Empty)
        {
            DirectoryInfo dir = new DirectoryInfo(directory);

            foreach (DirectoryInfo subDir in dir.GetDirectories())
            {
                if (!subDir.FullName.Contains("_svn") && !subDir.FullName.Contains(".svn"))
                {
                    RadTreeNode node = new RadTreeNode(subDir.Name);
                    node.ImageUrl        = "../RadControls/Grid/Skins/Default2006/folder.gif";
                    node.Value           = subDir.FullName;
                    node.ContextMenuName = "treeContextMenu";
                    node.Category        = "Folder";
                    collection.Add(node);
                    GetFileList(subDir.FullName, node.Nodes);
                    checkfiles(subDir.FullName, node.Nodes);
                }
            }

            //foreach (FileInfo file in dir.GetFiles())
            //{
            //    if (!file.FullName.Contains("_svn") && !file.FullName.Contains(".svn"))
            //    {
            //        RadTreeNode node = new RadTreeNode(file.Name);
            //        node.ImageUrl = "../RadControls/Grid/Skins/Default2006/" + GetImageForExtension(file.FullName.Substring(file.FullName.IndexOf(".")));
            //        node.Value = file.FullName;
            //        node.ContextMenuName = "Folder";
            //        node.Category = "Folder";
            //        collection.Add(node);
            //    }
            //}
        }
    }
Exemplo n.º 3
0
    private RadTreeNodeCollection RecursiveAdd(Dictionary <int, Geographies> lookup, int parentIdentity, int levels)
    {
        RadTreeNodeCollection result = new RadTreeNodeCollection(this.Tree);

        foreach (Geography geo in lookup[parentIdentity])
        {
            RadTreeNode node = new RadTreeNode(geo.Name, geo.Identity.ToString());

            if (lookup.ContainsKey(geo.Identity) && (levels > 0))
            {
                RadTreeNodeCollection collection = RecursiveAdd(lookup, geo.Identity, levels - 1);

                foreach (RadTreeNode subnode in collection)
                {
                    node.Nodes.Add(subnode);
                }
            }

            if (levels > 0)
            {
                node.Expanded = true;
            }
            if (levels < 1)
            {
                node.ExpandMode = TreeNodeExpandMode.WebService;
            }
            result.Add(node);
        }

        return(result);
    }
Exemplo n.º 4
0
    private void Populate(FinancialAccounts accounts)
    {
        // We still need a real f*****g tree structure.

        Dictionary <int, FinancialAccounts> lookup = new Dictionary <int, FinancialAccounts>();

        foreach (FinancialAccount account in accounts)
        {
            if (!lookup.ContainsKey(account.ParentIdentity))
            {
                lookup[account.ParentIdentity] = new FinancialAccounts();
            }

            lookup[account.ParentIdentity].Add(account);
        }

        RadTreeNodeCollection collection = RecursiveAdd(lookup, accounts[0].ParentIdentity);

        foreach (RadTreeNode subnode in collection)
        {
            Tree.Nodes.Add(subnode);
        }

        //Tree.Nodes[0].Expanded = true;
        //Tree.Nodes[0].Selected = true;
    }
Exemplo n.º 5
0
        private void _filterOutTreeNodesRecursive(RadTreeNodeCollection Nodes)
        {
            foreach (RadTreeNode TreeNode in Nodes)
            {
                string[] SplitValue = TreeNode.Value.Split('_');
                ViewType ThisType   = (ViewType)Enum.Parse(typeof(ViewType), SplitValue[0]);
                if ((!IncludeReports && (            //ThisType == ViewType.ReportCategory ||
                         ThisType == ViewType.Report //||
                         //( ThisType == ViewType.Root && TreeNode.Text == "Reports" )
                         )) ||
                    (!IncludeActions && (ThisType == ViewType.Action //||
                                                                     //( ThisType == ViewType.Root && TreeNode.Text == "Actions" )
                                         )) ||
                    (SearchableViewsOnly && (ThisType == ViewType.View &&
                                             TreeNode.Attributes["Searchable"].ToString() == "false")))
                {
                    TreeNode.Visible = false;
                }

                if (TreeNode.Nodes.Count > 0)
                {
                    _filterOutTreeNodesRecursive(TreeNode.Nodes);
                }
            }
        }
Exemplo n.º 6
0
        private bool SetSelectedNode(RadTreeNodeCollection nodes, string name, string text)
        {
            if (nodes != null && nodes.Count > 0)
            {
                foreach (RadTreeNode nd in nodes)
                {
                    if (name != null && name != string.Empty)
                    {
                        if (nd.Name.ToUpper() == name.ToUpper())
                        {
                            this.SelectedNode = nd;

                            return(true);
                        }
                    }
                    else if (text != null && text != string.Empty && nd.Text.ToUpper() == text.ToUpper())
                    {
                        this.SelectedNode = nd;

                        return(true);
                    }
                }

                foreach (RadTreeNode nd in nodes)
                {
                    if (SetSelectedNode(nd.Nodes, name, text))
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
Exemplo n.º 7
0
        protected void rtvRolesDisponibles_NodeDrop(object sender, RadTreeNodeDragDropEventArgs e)
        {
            //if (e.DestDragNode.ParentNode.Value == e.SourceDragNode.ParentNode.Value)
            //{
            //    foreach (RadTreeNode nodo in e.DestDragNode.ParentNode.Nodes)
            //    {
            //        GestionarRolDeUsuario(nodo, false);
            //    }
            //}
            //else //busca
            if (e.DestDragNode != null)
            {
                RadTreeNodeCollection nodos = e.DestDragNode.ParentNode.TreeView.Nodes;
                for (int i = 0; i < nodos.Count; i++)
                {
                    if (nodos[i].Value == e.SourceDragNode.ParentNode.Value)
                    {
                        foreach (RadTreeNode nodo in nodos[i].Nodes)
                        {
                            GestionarRolDeUsuario(nodo, false);
                        }
                    }
                }
            }

            GestionarRolDeUsuario(e.DraggedNodes[0], true);
        }
Exemplo n.º 8
0
        private void _initTreeFromViewRecursive(CswNbtViewNode ViewNode, RadTreeNodeCollection Nodes, ViewTreeSelectType SelectType)
        {
            RadTreeNode newNode = null;

            newNode = _CreateNode(ViewNode, SelectType);
            Nodes.Add(newNode);

            // Recurse
            if (ViewNode is CswNbtViewRoot)
            {
                foreach (CswNbtViewRelationship Child in ((CswNbtViewRoot)ViewNode).ChildRelationships)
                {
                    _initTreeFromViewRecursive(Child, newNode.Nodes, SelectType);
                }
            }
            else if (ViewNode is CswNbtViewRelationship)
            {
                foreach (CswNbtViewProperty Child in ((CswNbtViewRelationship)ViewNode).Properties)
                {
                    _initTreeFromViewRecursive(Child, newNode.Nodes, SelectType);
                }
                foreach (CswNbtViewRelationship Child in ((CswNbtViewRelationship)ViewNode).ChildRelationships)
                {
                    _initTreeFromViewRecursive(Child, newNode.Nodes, SelectType);
                }
            }
            else if (ViewNode is CswNbtViewProperty)
            {
                foreach (CswNbtViewPropertyFilter Child in ((CswNbtViewProperty)ViewNode).Filters)
                {
                    _initTreeFromViewRecursive(Child, newNode.Nodes, SelectType);
                }
            }
        }
Exemplo n.º 9
0
        private void RestoreTreeViewExpandedState(RadTreeNodeCollection nodes, List<bool?> list)
        {
            foreach (RadTreeNode node in nodes)
            {
                if (RestoreTreeViewIndex >= list.Count) return;

                node.Expanded = (bool)list[RestoreTreeViewIndex++];
                if (node.Nodes.Count > 0)
                {
                    RestoreTreeViewExpandedState(node.Nodes, list);
                    RadTreeNode _selectedNode = new RadTreeNode();

                    _selectedNode = (RadTreeNode)HttpContext.Current.Session["_selectedNode"];

                    foreach (RadTreeNode _node in node.Nodes)
                    {
                        if (_selectedNode != null)
                        {
                            string _nodeText = _node.Text;
                            string _selectedNodeText = _selectedNode.Text;
                            if (_node.Text == _selectedNode.Text)
                                _node.Selected = true;
                        }
                    }
                }
            }
        }
Exemplo n.º 10
0
    private RadTreeNodeCollection RecursiveAdd(Dictionary <int, Organizations> lookup, int parentIdentity, int levels)
    {
        RadTreeNodeCollection result = new RadTreeNodeCollection(this.Tree);

        foreach (Organization org in lookup[parentIdentity])
        {
            RadTreeNode node = new RadTreeNode(org.Name, org.Identity.ToString());
            SetAuthorityForNode(node);

            if (lookup.ContainsKey(org.Identity) && (levels > 0))
            {
                RadTreeNodeCollection collection = RecursiveAdd(lookup, org.Identity, levels - 1);

                foreach (RadTreeNode subnode in collection)
                {
                    node.Nodes.Add(subnode);
                }
            }

            if (levels > 0)
            {
                node.Expanded = true;
            }
            if (levels < 1)
            {
                node.ExpandMode = TreeNodeExpandMode.WebService;
            }
            result.Add(node);
        }


        return(result);
    }
Exemplo n.º 11
0
    public RadTreeNode EnsureGeographyLoaded(int geoToLoad, int expandTree)
    {
        try
        {
            RadTreeNode nod = Tree.FindNodeByValue(geoToLoad.ToString());
            if (nod != null)
            {
                //Already loaded, just return it.
                if (expandTree == 1)
                {
                    nod.ExpandParentNodes();
                }
                return(nod);
            }

            //get the line to make sure all nodes down to the selected are loaded;
            BasicGeography[] line = GeographyCache.GetGeographyLine(geoToLoad);

            if (Tree.Nodes.Count == 0)
            {
                // Tree is empty, insert the root.
                Tree.Nodes.Add(new RadTreeNode(this.Root.Name, this.Root.Identity.ToString()));
            }
            BasicGeography        parentbg         = null;
            RadTreeNodeCollection parentCollection = null;
            nod = Tree.Nodes[0];
            foreach (BasicGeography bg in line)
            {
                nod = Tree.FindNodeByValue(bg.Identity.ToString());
                if (parentbg == null)
                {
                    if (nod != null)
                    {
                        parentbg         = bg;
                        parentCollection = nod.Nodes;
                    }
                }
                else
                {
                    // if node found that parent is already loaded
                    if (nod == null)
                    {
                        AddChildren(parentCollection, parentbg.Identity);
                        nod = Tree.FindNodeByValue(bg.Identity.ToString());
                        nod.ParentNode.ExpandMode = TreeNodeExpandMode.ClientSide;
                    }
                    nod.ParentNode.Expanded = (expandTree == 0) ? nod.ParentNode.Expanded : (expandTree < 0) ? false : true;
                    parentbg         = bg;
                    parentCollection = nod.Nodes;
                }
            }
            Tree.Nodes[0].Expanded = (expandTree == 0) ? Tree.Nodes[0].Expanded : (expandTree < 0) ? false : true;;
            return(nod);
        }
        catch
        {
            return(null);
        }
    }
Exemplo n.º 12
0
 private static void RemoveNodes(RadTreeNodeCollection nodes)
 {
     while (nodes.Count > 0)
     {
         RemoveNodes(nodes[0].Nodes);
         nodes.Remove(nodes[0]);
     }
 }
Exemplo n.º 13
0
 private void RecursiveSelectExsisting(ref HashSet <string> selected, RadTreeNodeCollection nodes)
 {
     foreach (var node in nodes)
     {
         selected.Add((string)node.Tag);
         RecursiveSelectExsisting(ref selected, node.Nodes);
     }
 }
Exemplo n.º 14
0
        private void AddNode(RadTreeNodeCollection nodes)
        {
            RadTreeNode newNode = new RadTreeNode();

            newNode.Text = "RadTreeNode";
            nodes.Add(newNode);
            this.radTreeView1.SelectedNode = newNode;
        }
Exemplo n.º 15
0
        private void radTreeView1_NodeExpandedChanging(object sender, RadTreeViewCancelEventArgs e)
        {
            RadTreeNodeCollection nodes = e.Node.Nodes;

            foreach (RadTreeNode node in nodes)
            {
                node.ImageIndex = node.Level;
            }
        }
Exemplo n.º 16
0
        private void dragDropService_PreviewDragDrop(object sender, RadDropEventArgs e)
        {
            GridDataRowElement rowElement = e.DragInstance as GridDataRowElement;

            if (rowElement == null)
            {
                return;
            }
            string          sourceText        = rowElement.RowInfo.Cells[0].Value.ToString();
            TreeNodeElement targetNodeElement = e.HitTarget as TreeNodeElement;

            if (targetNodeElement != null)
            {
                RadTreeViewElement treeViewElement = targetNodeElement.TreeViewElement;
                RadTreeNode        targetNode      = targetNodeElement.Data;
                DropPosition       dropPosition    = this.GetDropPosition(e.DropLocation, targetNodeElement);

                switch (dropPosition)
                {
                case DropPosition.None:
                    break;

                case DropPosition.BeforeNode:
                    radGridView1.Rows.Remove(rowElement.RowInfo);

                    RadTreeNodeCollection nodes = targetNode.Parent == null ? treeViewElement.Nodes : targetNode.Parent.Nodes;
                    nodes.Insert(targetNode.Index, new RadTreeNode(sourceText));

                    break;

                case DropPosition.AfterNode:
                    radGridView1.Rows.Remove(rowElement.RowInfo);

                    RadTreeNodeCollection nodes1 = targetNode.Parent == null ? treeViewElement.Nodes : targetNode.Parent.Nodes;
                    int targetIndex = targetNodeElement.Data.Index <= treeViewElement.Nodes.Count - 1 ?
                                      (targetNodeElement.Data.Index + 1) : treeViewElement.Nodes.Count - 1;
                    nodes1.Insert(targetIndex, new RadTreeNode(sourceText));

                    break;

                case DropPosition.AsChildNode:
                    radGridView1.Rows.Remove(rowElement.RowInfo);

                    targetNode.Nodes.Add(new RadTreeNode(sourceText));

                    break;
                }
            }

            RadTreeViewElement treeElement = e.HitTarget as RadTreeViewElement;

            if (treeElement != null)
            {
                radGridView1.Rows.Remove(rowElement.RowInfo);
                radTreeView1.Nodes.Add(new RadTreeNode(sourceText));
            }
        }
Exemplo n.º 17
0
 private void RecursiveSelect(ref HashSet <string> selected, RadTreeNodeCollection nodes)
 {
     foreach (var node in nodes)
     {
         if (selected.Contains((string)node.Tag))
         {
             node.Checked = true;
         }
         RecursiveSelect(ref selected, node.Nodes);
     }
 }
Exemplo n.º 18
0
 private void AddChildren(RadTreeNodeCollection coll, int parentIdentity)
 {
     BasicOrganization[] orgs = OrganizationCache.GetOrganizationChildren(parentIdentity);
     foreach (BasicOrganization org in orgs)
     {
         RadTreeNode node = new RadTreeNode(org.Name, org.Identity.ToString());
         SetAuthorityForNode(node);
         node.ExpandMode = TreeNodeExpandMode.WebService;
         coll.Add(node);
     }
 }
Exemplo n.º 19
0
        private void RecursiveSync(RadTreeNodeCollection nodes)
        {
            foreach (var node in nodes)
            {
                try
                {
                    if (!node.Checked)
                    {
                        continue;
                    }

                    if (node.Nodes != null && node.Nodes.Count > 0)
                    {
                        var destination = publicPath + (string)node.Tag;
                        if (!Directory.Exists(destination))
                        {
                            Directory.CreateDirectory(destination);
                        }

                        var source      = privatePath + (string)node.Tag;
                        var sourceFiles = new HashSet <string>(Directory.GetFiles(source).Select(x => x.Replace(source, "")));
                        foreach (var file in Directory.GetFiles(destination).Select(x => x.Replace(destination, "").Replace(".aes", "")))
                        {
                            if (!sourceFiles.Contains(file))
                            {
                                File.Delete(destination + file);
                            }
                        }

                        RecursiveSync(node.Nodes);
                    }
                    else
                    {
                        try
                        {
                            SecureCopy.Copy(privatePath + (string)node.Tag, publicPath + (string)node.Tag);
                        }
                        catch (IOException)
                        {
                            // ignore
                        }
                    }
                }
                catch (UnauthorizedAccessException)
                {
                    // ignore
                }
                catch (Exception)
                {
                    // ignore
                }
            }
        }
Exemplo n.º 20
0
 private void AutoExpand(int level, RadTreeNodeCollection nodes)
 {
     if (level-- <= 0 || nodes.Count == 0)
     {
         return;
     }
     foreach (RadTreeNode node in nodes)
     {
         node.Expanded = true;
         AutoExpand(level, node.Nodes);
     }
 }
Exemplo n.º 21
0
        private void UpdatePosition(bool bUp)
        {
            int selectedOrder            = -1
            , newOrder                   = -1;
            string      selectedNodeName = radTreeView1.SelectedNode.Name;
            RadTreeNode selectedNode;

            selectedOrder = radTreeView1.SelectedNode.Index;
            if (bUp)
            {
                newOrder = selectedOrder - 1;
            }
            else
            {
                newOrder = selectedOrder + 1;
            }

            if (radTreeView1.SelectedNodes.Count > 1)
            {
                MessageBox.Show("Select Only One Node to move", "SMS Manager - Error Notification");
            }
            else
            {
                RadTreeNodeCollection nodes = null;
                if (radTreeView1.SelectedNode.Parent == null)
                {
                    nodes = radTreeView1.Nodes;
                }
                else
                {
                    nodes = radTreeView1.SelectedNode.Parent.Nodes;
                }
                nodes.Move(selectedOrder, newOrder);
                foreach (RadTreeNode node in nodes)
                {
                    //update order

                    authTableAdapter.UpdateOrderNum(short.Parse(node.Index.ToString())
                                                    , int.Parse(node.Value.ToString()));
                }
                authTableAdapter.Fill(this.fingermachDataSet.auth);
                //make sure selection is still on the node
                selectedNode = radTreeView1.GetNodeByName(selectedNodeName);
                radTreeView1.SelectedNode = selectedNode;
                selectedNode.Selected     = true;
                if (selectedNode.Parent != null)
                {
                    radTreeView1.SelectedNode.Parent.Expand();
                }
            }
        }
Exemplo n.º 22
0
 private void GetExpandedNodes(RadTreeNodeCollection nodes, System.Collections.Generic.List <string> ExpandedNodes)
 {
     foreach (RadTreeNode n in nodes)
     {
         if (n.Expanded)
         {
             ExpandedNodes.Add(n.Level + " " + n.Value);
         }
         if (n.Nodes.Count > 0 && n.Level < 5)
         {
             GetExpandedNodes(n.Nodes, ExpandedNodes);
         }
     }
 }
        private void LocalizeSelectedItems(bool localize, RadTreeNodeCollection nodes)
        {
            foreach (RadTreeNode node in nodes)
            {
                var moduleLocalization = (ModuleLocalization) node.FindControl("moduleLocalization");
                if (moduleLocalization != null)
                {
                    moduleLocalization.LocalizeSelectedItems(localize);

                    //Recursively call for child nodes
                    LocalizeSelectedItems(localize, node.Nodes);
                }
            }
        }
Exemplo n.º 24
0
        private void LocalizeSelectedItems(bool localize, RadTreeNodeCollection nodes)
        {
            foreach (RadTreeNode node in nodes)
            {
                dynamic moduleLocalization = node.FindControl("moduleLocalization");
                if (moduleLocalization != null)
                {
                    moduleLocalization.LocalizeSelectedItems(localize);

                    //Recursively call for child nodes
                    LocalizeSelectedItems(localize, node.Nodes);
                }
            }
        }
Exemplo n.º 25
0
 private void AddChildren(RadTreeNodeCollection coll, int parentIdentity)
 {
     BasicGeography[] geos = GeographyCache.GetGeographyChildren(parentIdentity);
     foreach (BasicGeography geo in geos)
     {
         RadTreeNode node = new RadTreeNode(geo.Name, geo.Identity.ToString());
         node.ExpandMode = TreeNodeExpandMode.ClientSide;
         coll.Add(node);
         if ((GeographyCache.CountGeographyChildren(geo.Identity)) > 0)
         {
             node.ExpandMode = TreeNodeExpandMode.WebService;
         }
         node.Expanded = node.ParentNode.Expanded;
     }
 }
Exemplo n.º 26
0
        private void MarkTranslatedSelectedItems(bool translated, RadTreeNodeCollection nodes)
        {
            foreach (RadTreeNode node in nodes)
            {
                dynamic moduleLocalization = node.FindControl("moduleLocalization");
                dynamic tabLocalization    = node.FindControl("tabLocalization");
                if (moduleLocalization != null)
                {
                    moduleLocalization.MarkTranslatedSelectedItems(translated);
                }
                if (tabLocalization != null)
                {
                    tabLocalization.MarkTranslatedSelectedItems(translated);
                }

                //Recursively call for child nodes
                MarkTranslatedSelectedItems(translated, node.Nodes);
            }
        }
Exemplo n.º 27
0
 private void checkfiles(string directory, RadTreeNodeCollection collection)
 {
     if (directory != string.Empty)
     {
         DirectoryInfo dir = new DirectoryInfo(directory);
         foreach (FileInfo file in dir.GetFiles())
         {
             if (!file.FullName.Contains("_svn") && !file.FullName.Contains(".svn"))
             {
                 RadTreeNode node = new RadTreeNode(file.Name);
                 node.ImageUrl        = "../RadControls/Grid/Skins/Default2006/" + GetImageForExtension(file.FullName.Substring(file.FullName.IndexOf(".")));
                 node.Value           = file.FullName;
                 node.ContextMenuName = "treeContextMenu";
                 node.Category        = "Files";
                 collection.Add(node);
             }
         }
     }
 }
Exemplo n.º 28
0
        void _tree_NodeCheckedChanged(object sender, RadTreeViewEventArgs e)
        {
            if (e.Node != m_SelectedNode)
            {
                return;
            }
            RadTreeNode           rootNode = null;
            BlockItemGroup        group    = null;
            RadTreeNodeCollection nodes    = null;

            if (e.Node.Level == 0)
            {
                rootNode = e.Node;
                group    = (e.Node.Tag as BlockItemGroup);
                nodes    = e.Node.Nodes;
            }
            else if (e.Node.Level == 1)
            {
                rootNode = e.Node.Parent;
                group    = (e.Node.Parent.Tag as BlockItemGroup);
                nodes    = e.Node.Parent.Nodes;
            }
            List <PrjEnvelopeItem> checkedNodes = new List <PrjEnvelopeItem>();
            int i = 0;

            foreach (RadTreeNode node in rootNode.Nodes)
            {
                if (node.Checked)
                {
                    checkedNodes.Add(node.Tag as PrjEnvelopeItem);
                    i++;
                }
            }
            BlockItemGroup bg = new BlockItemGroup(group.Name, group.Description, checkedNodes.ToArray());

            _blockDefinedSelected.Add(bg);
            rootNode.Text = string.Format("{0}[{1}]({3}/{2})", group.Name, group.Description, group.BlockItems.Length, i);
            if (CheckedChanged != null)
            {
                CheckedChanged(_blockDefinedSelected.GetPrjEnvelopeItems());
            }
        }
Exemplo n.º 29
0
        private void SaveTreeViewExpandedState(RadTreeNodeCollection nodes, List<bool?> list)
        {
            foreach (RadTreeNode node in nodes)
            {
                list.Add(node.Expanded);
                if (node.Nodes.Count > 0)
                {
                    SaveTreeViewExpandedState(node.Nodes, list);

                    foreach (RadTreeNode _node in node.Nodes)
                    {
                        if (_node.Selected)
                        {
                            HttpContext.Current.Session["_selectedNode"] = _node;
                        }
                    }

                }
            }
        }
Exemplo n.º 30
0
    private RadTreeNodeCollection RecursiveAdd(Dictionary <int, Geographies> lookup, int parentIdentity)
    {
        RadTreeNodeCollection result = new RadTreeNodeCollection(this.Tree);

        foreach (Geography geo in lookup[parentIdentity])
        {
            RadTreeNode node = new RadTreeNode(geo.Name, geo.Identity.ToString());

            if (lookup.ContainsKey(geo.Identity))
            {
                RadTreeNodeCollection collection = RecursiveAdd(lookup, geo.Identity);

                foreach (RadTreeNode subnode in collection)
                {
                    node.Nodes.Add(subnode);
                }
            }

            result.Add(node);
        }

        return(result);
    }
Exemplo n.º 31
0
    private RadTreeNodeCollection RecursiveAdd(Dictionary <int, Organizations> lookup, int parentIdentity)
    {
        RadTreeNodeCollection result = new RadTreeNodeCollection(this.Tree);

        foreach (Organization org in lookup[parentIdentity])
        {
            RadTreeNode node = new RadTreeNode(org.NameShort, org.Identity.ToString());

            if (lookup.ContainsKey(org.Identity))
            {
                RadTreeNodeCollection collection = RecursiveAdd(lookup, org.Identity);

                foreach (RadTreeNode subnode in collection)
                {
                    node.Nodes.Add(subnode);
                }
            }

            result.Add(node);
        }

        return(result);
    }
Exemplo n.º 32
0
    private void LoadTreeViewImages(string folder, RadTreeNodeCollection maincollection)
    {
        string[] dirs = Directory.GetDirectories(folder);
        foreach (string path in dirs)
        {
            if (!path.Contains("_svn") && !path.Contains(".svn"))
            {
                string[]    parts    = path.Split('\\');
                string      name     = parts[parts.Length - 1];
                RadTreeNode rootNode = new RadTreeNode(name);
                rootNode.ImageUrl        = "../RadControls/Grid/Skins/Default2006/folder.gif";
                rootNode.Category        = "Folder";
                rootNode.Value           = folder;
                rootNode.ContextMenuName = "treeContextMenu";
                maincollection.Add(rootNode);
                checkfiles(path, rootNode.Nodes);

                GetFileList(path, rootNode.Nodes);

                // BindDirectory(path, rootNode.Nodes);
            }
        }
    }
Exemplo n.º 33
0
    private RadTreeNodeCollection RecursiveAdd(Dictionary <int, FinancialAccounts> lookup, int parentIdentity)
    {
        RadTreeNodeCollection result = new RadTreeNodeCollection(this.Tree);

        foreach (FinancialAccount account in lookup[parentIdentity])
        {
            RadTreeNode node = new RadTreeNode(account.Name, account.Identity.ToString());

            if (lookup.ContainsKey(account.Identity))
            {
                RadTreeNodeCollection collection = RecursiveAdd(lookup, account.Identity);

                foreach (RadTreeNode subnode in collection)
                {
                    node.Nodes.Add(subnode);
                }
            }

            result.Add(node);
        }

        return(result);
    }
Exemplo n.º 34
0
    private RadTreeNodeCollection RecursiveAdd (Dictionary<int,Organizations> lookup, int parentIdentity)
    {
        RadTreeNodeCollection result = new RadTreeNodeCollection(this.Tree);

        foreach (Organization org in lookup[parentIdentity])
        {
            RadTreeNode node = new RadTreeNode(org.NameShort, org.Identity.ToString());

            if (lookup.ContainsKey(org.Identity))
            {
                RadTreeNodeCollection collection = RecursiveAdd(lookup, org.Identity);

                foreach (RadTreeNode subnode in collection)
                {
                    node.Nodes.Add(subnode);
                }
            }

            result.Add(node);
        }

        return result;
    }
Exemplo n.º 35
0
    private void LoadTreeViewImages(string folder, RadTreeNodeCollection maincollection)
    {
        string[] dirs = Directory.GetDirectories(folder);
        foreach (string path in dirs)
        {
            if (!path.Contains("_svn") && !path.Contains(".svn"))
            {
                string[] parts = path.Split('\\');
                string name = parts[parts.Length - 1];
                RadTreeNode rootNode = new RadTreeNode(name);
                rootNode.ImageUrl = "../RadControls/Grid/Skins/Default2006/folder.gif";
                rootNode.Category = "Folder";
                rootNode.Value = folder;
                rootNode.ContextMenuName = "treeContextMenu";
                maincollection.Add(rootNode);
                checkfiles(path, rootNode.Nodes);

                GetFileList(path, rootNode.Nodes);

               // BindDirectory(path, rootNode.Nodes);
            }
        }
    }
Exemplo n.º 36
0
 /// <summary>
 /// Deletes the nodes.
 /// </summary>
 /// <param name="nodeCollection">The node collection.</param>
 private void DeleteNodes(RadTreeNodeCollection nodeCollection)
 {
     if (nodeCollection != null)
     {
         for (int intNodeCounter = nodeCollection.Count - 1; intNodeCounter >= 0; intNodeCounter--)
         {
             nodeCollection.RemoveAt(intNodeCounter);
         }
     }
 }
 public FormFamilyBuilderAll(RadTreeNodeCollection dna)
 {
     InitializeComponent();
     nodes = dna;
 }
        private void MarkTranslatedSelectedItems(bool translated, RadTreeNodeCollection nodes)
        {
            foreach (RadTreeNode node in nodes)
            {
                var moduleLocalization = (ModuleLocalization) node.FindControl("moduleLocalization");
                var tabLocalization = (TabLocalization) node.FindControl("tabLocalization");
                if (moduleLocalization != null)
                {
                    moduleLocalization.MarkTranslatedSelectedItems(translated);
                }
                if (tabLocalization != null)
                {
                    tabLocalization.MarkTranslatedSelectedItems(translated);
                }

                //Recursively call for child nodes
                MarkTranslatedSelectedItems(translated, node.Nodes);
            }
        }
Exemplo n.º 39
0
    private void AddChildren (RadTreeNodeCollection coll, int parentIdentity)
    {
        BasicOrganization[] orgs = OrganizationCache.GetOrganizationChildren(parentIdentity);
        foreach (BasicOrganization org in orgs)
        {
            RadTreeNode node = new RadTreeNode(org.Name, org.Identity.ToString());
            SetAuthorityForNode(node);
            node.ExpandMode = TreeNodeExpandMode.WebService;
            coll.Add(node);
        }

    }
Exemplo n.º 40
0
 /// <summary>
 /// Adds the last node.
 /// </summary>
 /// <param name="nodeCollection">The node collection.</param>
 /// <param name="nodeText">The node text.</param>
 /// <param name="nodeValue">The node value.</param>
 private void AddLastNode(RadTreeNodeCollection nodeCollection, string nodeText, string nodeValue)
 {
     RadTreeNode lastNode = new RadTreeNode();
     lastNode.Text = nodeText;
     lastNode.Value = nodeValue;
     lastNode.ExpandMode = TreeNodeExpandMode.ClientSide;
     lastNode.EnableContextMenu = false;
     lastNode.Checkable = false;
     if(nodeValue.Equals(AssetTreeConstants.ERROR))
     {
         lastNode.ForeColor = System.Drawing.Color.Red;
     }
     nodeCollection.Add(lastNode);
 }
Exemplo n.º 41
0
 /// <summary>
 /// Adds the root search box.
 /// </summary>
 /// <param name="nodeCollection">The node collection.</param>
 /// 
 private void AddRootSearchBox(RadTreeNodeCollection nodeCollection)
 {
     RadTreeNode firstNode = new RadTreeNode();
     firstNode.Text = GetSearchBoxHTML(string.Empty, "Asset Tree", GetNodeAttributeValue(xmlNodeCurrentLevel, AssetTreeConstants.ASSETNAME));
     firstNode.Value = AssetTreeConstants.ROOTSEARCHBOXNODE;
     firstNode.ExpandMode = TreeNodeExpandMode.ClientSide;
     firstNode.EnableContextMenu = false;
     firstNode.Checkable = false;
     nodeCollection.Add(firstNode);
 }
Exemplo n.º 42
0
        /// <summary>
        /// Returneaza o lista de Lectii convertite din Colectia de noduri de tip lectie specificata
        /// si returneaza rezultatul operatiunii
        /// </summary>
        /// <param name="nodes">Lista de noduri de tip lectie</param>
        /// <returns></returns>
        private List<Lectie> GetLectiiChildren(RadTreeNodeCollection nodes)
        {
            if (nodes == null)
                return new List<Lectie>();

            var lista = new List<Lectie>();
            foreach (CustomTreeNode<Lectie> node in nodes)
            {
                if (node.CustomStruct == null)
                    continue;

                if (node.CustomStruct.Lectii == null)
                    node.CustomStruct.Lectii = new List<Lectie>();
                node.CustomStruct.Lectii.Clear();
                node.CustomStruct.Lectii.AddRange(GetLectiiChildren(node.Nodes));

                lista.Add(node.CustomStruct);
            }
            return lista;
        }
Exemplo n.º 43
0
    private RadTreeNodeCollection RecursiveAdd (Dictionary<int, Geographies> lookup, int parentIdentity, int levels)
    {

        RadTreeNodeCollection result = new RadTreeNodeCollection(this.Tree);

        foreach (Geography geo in lookup[parentIdentity])
        {
            RadTreeNode node = new RadTreeNode(geo.Name, geo.Identity.ToString());

            if (lookup.ContainsKey(geo.Identity) && (levels > 0))
            {
                RadTreeNodeCollection collection = RecursiveAdd(lookup, geo.Identity, levels - 1);

                foreach (RadTreeNode subnode in collection)
                {
                    node.Nodes.Add(subnode);
                }
            }

            if (levels > 0)
                node.Expanded = true;
            if (levels < 1)
                node.ExpandMode = TreeNodeExpandMode.WebService;
            result.Add(node);
        }

        return result;
    }
Exemplo n.º 44
0
    private RadTreeNodeCollection RecursiveAdd (Dictionary<int, Organizations> lookup, int parentIdentity, int levels)
    {

        RadTreeNodeCollection result = new RadTreeNodeCollection(this.Tree);

        foreach (Organization org in lookup[parentIdentity])
        {
            RadTreeNode node = new RadTreeNode(org.Name, org.Identity.ToString());
            SetAuthorityForNode(node);

            if (lookup.ContainsKey(org.Identity) && (levels > 0))
            {
                RadTreeNodeCollection collection = RecursiveAdd(lookup, org.Identity, levels - 1);

                foreach (RadTreeNode subnode in collection)
                {
                    node.Nodes.Add(subnode);
                }
            }

            if (levels > 0)
                node.Expanded = true;
            if (levels < 1)
                node.ExpandMode = TreeNodeExpandMode.WebService;
            result.Add(node);
        }


        return result;
    }
Exemplo n.º 45
0
    private RadTreeNodeCollection RecursiveAdd (Dictionary<int, Geographies> lookup, int parentIdentity)
    {
        RadTreeNodeCollection result = new RadTreeNodeCollection(this.Tree);

        foreach (Geography geo in lookup[parentIdentity])
        {
            RadTreeNode node = new RadTreeNode(geo.Name, geo.Identity.ToString());

            if (lookup.ContainsKey(geo.Identity))
            {
                RadTreeNodeCollection collection = RecursiveAdd(lookup, geo.Identity);

                foreach (RadTreeNode subnode in collection)
                {
                    node.Nodes.Add(subnode);
                }
            }

            result.Add(node);
        }

        return result;
    }
Exemplo n.º 46
0
    private void checkfiles(string directory, RadTreeNodeCollection collection)
    {
        if (directory != string.Empty)
        {

            DirectoryInfo dir = new DirectoryInfo(directory);
            foreach (FileInfo file in dir.GetFiles())
            {
                if (!file.FullName.Contains("_svn") && !file.FullName.Contains(".svn"))
                {
                    RadTreeNode node = new RadTreeNode(file.Name);
                    node.ImageUrl = "../RadControls/Grid/Skins/Default2006/" + GetImageForExtension(file.FullName.Substring(file.FullName.IndexOf(".")));
                    node.Value = file.FullName;
                    node.ContextMenuName = "treeContextMenu";
                    node.Category = "Files";
                    collection.Add(node);
                }
            }
        }
    }
Exemplo n.º 47
0
    private void GetFileList(string directory, RadTreeNodeCollection collection)
    {
        if (directory != string.Empty)
        {

            DirectoryInfo dir = new DirectoryInfo(directory);

            foreach (DirectoryInfo subDir in dir.GetDirectories())
            {
                if (!subDir.FullName.Contains("_svn") && !subDir.FullName.Contains(".svn"))
                {
                    RadTreeNode node = new RadTreeNode(subDir.Name);
                    node.ImageUrl = "../RadControls/Grid/Skins/Default2006/folder.gif";
                    node.Value = subDir.FullName;
                    node.ContextMenuName = "treeContextMenu";
                    node.Category = "Folder";
                    collection.Add(node);
                    GetFileList(subDir.FullName, node.Nodes);
                    checkfiles(subDir.FullName, node.Nodes);

                }
            }

            //foreach (FileInfo file in dir.GetFiles())
            //{
            //    if (!file.FullName.Contains("_svn") && !file.FullName.Contains(".svn"))
            //    {
            //        RadTreeNode node = new RadTreeNode(file.Name);
            //        node.ImageUrl = "../RadControls/Grid/Skins/Default2006/" + GetImageForExtension(file.FullName.Substring(file.FullName.IndexOf(".")));
            //        node.Value = file.FullName;
            //        node.ContextMenuName = "Folder";
            //        node.Category = "Folder";
            //        collection.Add(node);
            //    }
            //}
        }
    }
Exemplo n.º 48
0
 private void AddChildren (RadTreeNodeCollection coll, int parentIdentity)
 {
     BasicGeography[] geos = GeographyCache.GetGeographyChildren(parentIdentity);
     foreach (BasicGeography geo in geos)
     {
         RadTreeNode node = new RadTreeNode(geo.Name, geo.Identity.ToString());
         node.ExpandMode = TreeNodeExpandMode.ClientSide;
         coll.Add(node);
         if ((GeographyCache.CountGeographyChildren(geo.Identity)) > 0)
         {
             node.ExpandMode = TreeNodeExpandMode.WebService;
         }
         node.Expanded = node.ParentNode.Expanded;
     }
 }
Exemplo n.º 49
0
    private RadTreeNodeCollection RecursiveAdd(Dictionary<int, FinancialAccounts> lookup, int parentIdentity)
    {
        RadTreeNodeCollection result = new RadTreeNodeCollection(this.Tree);

        foreach (FinancialAccount account in lookup[parentIdentity])
        {
            RadTreeNode node = new RadTreeNode(account.Name, account.Identity.ToString());

            if (lookup.ContainsKey(account.Identity))
            {
                RadTreeNodeCollection collection = RecursiveAdd(lookup, account.Identity);

                foreach (RadTreeNode subnode in collection)
                {
                    node.Nodes.Add(subnode);
                }
            }

            result.Add(node);
        }

        return result;
    }