Beispiel #1
0
        public void creatTheTree(DataSet mibDataSet, string parentName, ObjTreeInfo info)
        {
            //获取
            ObjTreeBase[] items = GetRecordByObjNameCh(mibDataSet, parentName);
            //如果没有字节点了,那就返回空
            if (0 == items.Length)
            {
                return;
            }
            List <ObjTreeInfo> infoList = new List <ObjTreeInfo>();

            for (int i = 0; i < items.Length; i++)
            {
                ObjTreeInfo tempInfo = new ObjTreeInfo();

                tempInfo.objNameCh       = items[i].objNameCh;
                tempInfo.objNameChParent = items[i].objNameChParent;
                tempInfo.level           = items[i].level;
                tempInfo.objNameMibTable = items[i].objNameMibTable;
                //递归循环
                creatTheTree(mibDataSet, items[i].objNameCh.ToString(), tempInfo);
                infoList.Add(tempInfo);
            }
            info.childObj = infoList.ToArray(); //由于对象是引用类型,因为可以改变参数的值
        }
Beispiel #2
0
 public ObjTressJsonData()
 {
     this.objTreeInfo       = new ObjTreeInfo();
     this.mibVersion        = "";
     this.stringObjTreeJson = "";
 }