private RegistryKeyTreeView[] GetRegistryKeyTreeViews(RegistryHive registryHive, string registryKeyPath)
        {
            var subKey = (registryKeyPath == "\\") ? registryHive.Root : registryHive.Root.OpenSubKey(registryKeyPath);

            RegistryKeyTreeView[] registryKeyTreeViews = new RegistryKeyTreeView[subKey.SubKeyCount];

            var i = 0;

            foreach (var subKeyDet in subKey.SubKeys)
            {
                var regChild = new RegistryKeyTreeView
                {
                    AttachedHive = registryHive,
                    ImageSource  = folderBitmap,
                    Name         = subKeyDet.Name.Split('\\').Last(), //TODO
                    Path         = subKeyDet.Name
                };

                if (subKeyDet.SubKeyCount > 0)
                {
                    regChild.LoadDummyChild();
                }

                registryKeyTreeViews[i] = regChild;

                i++;
            }

            return(registryKeyTreeViews);
        }
        private void LoadSubkey(RegistryKeyTreeView regKey)
        {
            if (regKey.IsDummy)
            {
                regKey.RemoveDummyChild();
            }

            var regKeyTreeViews = GetRegistryKeyTreeViews(regKey.AttachedHive, regKey.Path);

            for (int i = 0; i < regKeyTreeViews.Length; i++)
            {
                regKeyTreeViews[i].Root = regKey.Root;
                regKey.Children.Add(regKeyTreeViews[i]);
            }
        }