public void CloseAllSubkeys(RegistryNode node) { foreach (var nod in node.Nodes) { nod.Nodes?.Clear(); } }
public void OpenAllSubkeys(RegistryNode selectedNode, bool mainNodes = false) { Task.Run(() => { foreach (var node in selectedNode.Nodes) { node.Nodes = new ObservableCollection <RegistryNode>(); string[] names = node.Key.GetSubKeyNames(); foreach (var name in names) { try { var regNode = new RegistryNode { Name = name, Key = node.Key.OpenSubKey(name) }; Dispatcher.Invoke(() => { try { node.Nodes.Add(regNode); } catch (SecurityException se) { //Debug.WriteLine(se.Message); } }); } catch (SecurityException se) { Debug.WriteLine(se.Message); } } } }); }