private void ReloadTree() { using (new WaitCursor()) { trvList.Nodes.Clear(); lstItems.Items.Clear(); uEntity.Clear(); var items = UI.GetItems <ClippingRegion>() .OrderBy(x => x.Caption).ToList().GenerateTree(); TreeNode node = new TreeNode("raíz"); TreeItem <ClippingRegion> .MakeNodeTree(items, node); foreach (TreeNode item in node.Nodes) { trvList.Nodes.Add(item); } trvList.ExpandAll(); if (NoneSelected() == false) { var c = GetSelectedNode(); c.ClippingRegionItemsCount = null; uEntity.Fill(GetDetail(c)); LoadItems(c); } } }
private void ReloadTree() { using (new WaitCursor()) { using (new KeepSelectedTree(trvList)) { trvList.Nodes.Clear(); lstItems.Items.Clear(); uEntity.Clear(); var items = UI.GetGeographies().GenerateTree(); TreeNode node = new TreeNode("raíz"); TreeItem <Geography> .MakeNodeTree(items, node); foreach (TreeNode item in node.Nodes) { trvList.Nodes.Add(item); } trvList.ExpandAll(); if (NoneSelected() == false) { var c = GetSelectedNode(); c.GeographyItemsCount = null; uEntity.Fill(GetDetail(c)); LoadItems(c); } } } }
private void ReloadTree() { using (new KeepSelectedTree(trvList)) { trvList.Nodes.Clear(); lstClippingGeography.Items.Clear(); lstItems.Items.Clear(); using (new WaitCursor()) { TreeNode node = new TreeNode("raíz"); var relationsCount = UI.GetItems <ClippingRegionGeography>() .GroupBy(n => n.ClippingRegion.Id, (key, values) => new { ClippingRegionId = key, Count = values.Count() }) .ToDictionary(x => x.ClippingRegionId, x => x.Count); var items = UI.GetItems <ClippingRegion>() .OrderBy(x => x.Caption).ToList().GenerateTree(); TreeItem <ClippingRegion> .MakeNodeTree(items, node, relationsCount); foreach (TreeNode item in node.Nodes) { trvList.Nodes.Add(item); } trvList.ExpandAll(); LoadList(GetSelectedNode()); } } }
private void ReloadTree() { trvList.Nodes.Clear(); //lstItems.Items.Clear(); var items = UI.GetItems <LayerGroup>() .OrderBy(x => x.Caption).ToList().GenerateTree(); TreeNode node = new TreeNode("raíz"); TreeItem <LayerGroup> .MakeNodeTree(items, node); foreach (TreeNode item in node.Nodes) { trvList.Nodes.Add(item); } trvList.ExpandAll(); if (NoneSelected() == false) { LoadItems(GetSelectedNode()); } }