public static void Export(RegistryExplorer.Registry.RegKey key , ExportProvider provider) { provider.BeginExport(); ExportKey(key, provider); provider.EndExport(); }
private void LoadFavorites() { RegistryExplorer.Registry.RegKey favoritesKey = RegistryExplorer.Registry.RegKey.Parse( RegistryExplorer.Registry.RegistryExplorerr.RegistryFavoritePath ); if (favoritesKey == null) { return; } System.Collections.Generic.List <RegistryExplorer.Registry.RegValue> values = RegistryExplorer.Registry.RegistryExplorerr.GetValues(favoritesKey.Key); if (values.Count > 0) { values.ForEach(val => { string key = val.Data.ToString(); //removing "My Computer\" set by RegEdit key = key.Substring(key.IndexOf('\\') + 1); favorites[val.Name] = key; }); } }
static void ExportValues(RegistryExplorer.Registry.RegKey key, ExportProvider provider) { foreach (RegistryExplorer.Registry.RegValue value in RegistryExplorer.Registry.RegistryExplorerr.GetValues(key.Key)) { provider.WriteValue(value.Name, value.Kind, value.Data); } }
private bool ExportToFile( RegistryExplorer.Registry.RegKey key, RegistryExplorer.Export.RegExportFormat format, System.IO.Stream output ) { bool success = true; using (output) { DisableControls(); try { using (new BusyCursor(this)) { using (System.IO.StreamWriter writer = new System.IO.StreamWriter(output)) { RegistryExplorer.Export.RegExporter.Export( key , RegistryExplorer.Export.ExportProvider.Create(format, writer) ); } } } catch { success = false; } EnableControls(); } return(success); }
static void ExportKey(RegistryExplorer.Registry.RegKey key , ExportProvider provider) { provider.WriteKeyStart(key.Key.Name); ExportValues(key, provider); foreach (RegistryExplorer.Registry.RegKey subKey in RegistryExplorer.Registry.RegistryExplorerr.GetSubKeys(key.Key)) { ExportKey(subKey, provider); } provider.WriteKeyEnd(); }
void AddKeyToTree(TreeNode parent, RegistryExplorer.Registry.RegKey subKey) { Microsoft.Win32.RegistryKey key = subKey.Key; TreeNode newNode = CreateNode(key.Name, subKey.Name, key); parent.Nodes.Add(newNode); if (key.SubKeyCount > 0) { newNode.Nodes.Add(CreateNode()); } }
private void btOK_Click(object sender, System.EventArgs e) { RegistryExplorer.Registry.RegKey regKey = RegistryExplorer.Registry.RegKey.Parse( RegistryExplorer.Registry.RegistryExplorerr.RegistryFavoritePath, true ); foreach (object item in lstKeys.SelectedItems) { string key = item.ToString(); regKey.Key.DeleteValue(key); favorites.Remove(key); } }
private void tvwKeys_AfterLabelEdit(object sender, NodeLabelEditEventArgs e) { tvwKeys.LabelEdit = false; string keyName = e.Label == null ? e.Node.Text : e.Label; try { Microsoft.Win32.RegistryKey readOnlyParent = (Microsoft.Win32.RegistryKey)e.Node.Parent.Tag; RegistryExplorer.Registry.RegKey parent = RegistryExplorer.Registry.RegKey.Parse(readOnlyParent.Name, true); parent.Key.CreateSubKey(keyName); e.Node.Name = parent.Key.Name + "\\" + keyName; e.Node.Tag = RegistryExplorer.Registry.RegKey.Parse(e.Node.Name).Key; } catch { e.Node.Remove(); UIUtility.DisplayError(this, RegistryExplorer.Properties.Resources.Error_CreateKeyFail); } }