예제 #1
0
        public void TreeTest()
        {
            var root = new RegData()
            {
                _name = regroot
            };

            root.Fillit();
            //            Assert.IsTrue(RegData._cnt > 350, "count = {0}", RegData._cnt);

            using (var mfd = new MapFileDict <int, RegData>())
            {
                mfd[1] = root;
                var ret = mfd[1];
                Assert.IsTrue(ret.CompareTo(root) == 0, "not equal!");
            }
//            Assert.IsTrue(false, "Count = {0}", RegData._cnt);
        }
예제 #2
0
 public void Fillit(int nLevel = 0)
 {
     if (nLevel < 22)
     {
         using (var reg = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(_name))
         {
             var subkeys = reg.GetSubKeyNames();
             if (subkeys.Length > 0)
             {
                 _childNodes = new List <MHandle>();
                 foreach (var key in reg.GetSubKeyNames())
                 {
                     var newName = _name + @"\" + key;
                     var newnode = new RegData()
                     {
                         _name = newName
                     };
                     _childNodes.Add(_MemMap.AddData(newnode));
                     newnode.Fillit(nLevel + 1);
                 }
             }
         }
     }
 }