Beispiel #1
0
 private static void RecursiveAddAndVisualizePipeData(TreeList parentTree, List <LogicGroup> list, Dictionary <string, IFeatureClass> fcs, string geoColumnName)
 {
     if (parentTree == null || list == null)
     {
         return;
     }
     foreach (LogicGroup lg in list)
     {
         TreeNodeLogicGroup tnlg = new TreeNodeLogicGroup()
         {
             Name = string.IsNullOrEmpty(lg.Alias) ? lg.Name : lg.Alias
         };
         tnlg.OwnNode = parentTree.AppendNode(new object[] { tnlg.Name }, (TreeListNode)null);
         tnlg.Visible = true;
         RecursiveAddAndVisualizePipeData(tnlg.OwnNode.TreeList, lg.LogicGroups, fcs, geoColumnName);
         foreach (MajorClass mc in lg.MajorClasses)
         {
             TreeNodeMajorClass tnmc = new TreeNodeMajorClass()
             {
                 Name        = string.IsNullOrEmpty(mc.Alias) ? mc.Name : mc.Alias,
                 CustomValue = mc
             };
             tnlg.Add(tnmc);
             AddSubClass(mc, tnlg, fcs, geoColumnName);
         }
         tnlg.CollapseAll();
     }
 }
Beispiel #2
0
        public static void AddAndVisualizePipeData(IConnectionInfo ci, string geoColumnName, TreeList parentTree, bool bNeedFly = false, bool bTempData = true)
        {
            try
            {
                if (ci == null || parentTree == null)
                {
                    return;
                }

                Dictionary <string, IFeatureClass> fcs = DataUtils.GetFeatureClass(ci);
                if (fcs == null || fcs.Count == 0)
                {
                    return;
                }

                foreach (MajorClass mc in LogicDataStructureManage3D.Instance.RootMajorClasses)
                {
                    TreeNodeMajorClass tnmc = new TreeNodeMajorClass()
                    {
                        Name        = string.IsNullOrEmpty(mc.Alias) ? mc.Name : mc.Alias,
                        CustomValue = mc
                    };
                    tnmc.OwnNode = parentTree.AppendNode(new object[] { tnmc.Name }, (TreeListNode)null);
                    AddSubClass(mc, tnmc, fcs, geoColumnName);
                }

                foreach (LogicGroup lg in LogicDataStructureManage3D.Instance.RootLogicGroups)
                {
                    TreeNodeLogicGroup tnlg = new TreeNodeLogicGroup()
                    {
                        Name = string.IsNullOrEmpty(lg.Alias) ? lg.Name : lg.Alias
                    };
                    tnlg.OwnNode = parentTree.AppendNode(new object[] { tnlg.Name }, (TreeListNode)null);
                    tnlg.Visible = true;
                    RecursiveAddAndVisualizePipeData(tnlg.OwnNode.TreeList, lg.LogicGroups, fcs, geoColumnName);
                    foreach (MajorClass mc in lg.MajorClasses)
                    {
                        TreeNodeMajorClass tnmc = new TreeNodeMajorClass()
                        {
                            Name        = string.IsNullOrEmpty(mc.Alias) ? mc.Name : mc.Alias,
                            CustomValue = mc
                        };
                        tnlg.Add(tnmc);
                        AddSubClass(mc, tnmc, fcs, geoColumnName);
                    }
                    tnlg.CollapseAll();
                }
            }
            catch (Exception ex)
            {
            }
        }