ComponentSpace Registry Toolkit Class Library

Registry Toolkit Class Library

Introduction provides an overview of the Registry Toolkit Class Library.

Installation details the prerequisite system requirements and installation procedures for the Registry Toolkit Class Library.

Reference documents the namespaces and classes that constitute the Registry Toolkit Class Library.

Examples describes the included example code.

FAQ lists frequently asked questions.

Support describes how to get support.

Send comments on this topic.


Introduction

Although the Microsoft registry classes provide basic registry functionality, many useful features are missing. The Registry Toolkit extends this functionality to include renaming of keys, import/export in both standard Windows format and XML, searching, change notification, registry key name manipulation, registry key navigation and more. Written in 100% managed C# code, the control offers .NET developers a fast and simple way to perform many of the more demanding registry operations in their applications.

The Registry Toolkit is a .NET class library that may be used in any Windows or Web application by adding a reference to the assembly to access the classes in the ComponentSpace.RegistryToolkit namespace.

The RegistryHelper class includes methods for key name manipulation as well as key renaming. Extract the base key name, parent key name and sub-key name from a key. Create and open keys by name without the hassle of the Microsoft.Win32.Registry static field values. Rename keys.

The RegistryImporter and RegistryExporter classes respectively import and export registry keys in standard Windows Registry 5.0 format that’s compatible with regedit. The RegistryXmlImporter and RegistryXmlExporter classes respectively import and export registry keys in XML.

The RegistryWatcher class raises a RegistryChanged event whenever the specified key or its sub-tree changes.

The RegistrySearcher class starts a search at a specified key and optionally searches keys, values and data. Comprehensive regular expression support is included. Events are raised whenever a new key is being searched, a match is found, and the search has completed. The search may be terminated at any stage.

All classes that raise events support a SynchronizingObject property. All classes report errors through the RegistryToolkitException.

Features

  • Renaming of registry keys
  • Import/export in standard Windows Registry 5.0 format
  • Import/export in XML format
  • Receive notification of registry changes through events
  • Search registry keys, values and data with full regular expression support
  • Manipulate key names including extracting parent and base key names
  • 100% managed code written in C#
  • Object oriented design specifically for the .NET framework
  • All error handling through .NET exceptions
  • Comprehensive Visual Studio .NET style documentation
  • VB.NET and C# example source code
  • Includes prompt free email support
  • Royalty free runtime
  • Source code available

Getting Started

  • Install the product in your development environment.
  • Compile and run one of the examples.
  • Refer to the reference section for further details.
  • Add a reference to the class library in your application.
  • Once completed, distribute the class library with your application.


Installation

To install this product double click the .MSI file and follow the installation steps.

Prerequisites

The Microsoft .NET framework runtime must already be installed on your computer. The Microsoft .NET framework redistributable may be downloaded from msdn.microsoft.com.

You will also need a development environment such as Visual Studio .NET.

Distribution

The class library's runtime is royalty free which means it may be freely distributed with your application. The only file that should be distributed is the class library's DLL.


Reference

The reference section is contained within a separate help file.


Examples

Example code, developed using Microsoft Visual Studio .NET, is included with the product. You will find these projects in sub-directories of the installation directory.

ExportRegistry
Demonstrates exporting a registry key to a file in either standard Windows Registry Editor 5.00 format or as XML. This is a console application and should be run from the command line.
ImportRegistry
Demonstrates importing a registry key from a file in either standard Windows Registry Editor 5.00 format or as XML. This is a console application and should be run from the command line.
SearchRegistry
Demonstrates searching the registry.
WatchRegistry
Demonstrates watching the registry for changes.


FAQ

Frequently Asked Questions
  1. I can't build the examples. Why can't the ComponentSpace namespace be found?

    2. The assembly containing the namespace or the project referencing it has been moved. The simplest way to fix this is to re-add the reference to the project by browsing to where the DLL is located (typically the installation directory).

  2. What's the purpose of the Searching event?

    3. Searching is fired whenever a new subkey is being searched. The intention is to allow the application to provide user feedback. However, the frequency and associated cost of this event should be considered when designing your application.

  3. Why doesn't the RegistryWatcher specify which key changed?

    4. RegistryWatcher is implemented using the Win32 RegNotifyChangeKeyValue API call. Unfortunately this API provides no additional information. If you want to know what's changed then you would need to keep a snapshot of the registry section you're interested in and compare it with the current registry.

  4. Can I specify the XML format for the registry export?

    5. No. If you need the XML in a different format then the best approach is to map it to the required format using an XSLT stylesheet.

  5. Can I use this product to periodically backup the entire registry?

    6. Yes. Use the ExportRegistry example in conjunction with the Windows Task Scheduler.


Support

For further information, visit us at http://www.componentspace.com or send email to info@componentspace.com.

If have a bug to report or a product enhancement request send email to support@componentspace.com.