RegistryAccessPolicy Class
Allows you to spot, analyze, and prohibit unwanted requests to the system registry.
Namespace: DevExpress.Data.Utils
Assembly: DevExpress.Data.Desktop.v24.2.dll
Declaration
Remarks
DevExpress UI controls can save, read, and modify configuration settings and options in the system registry. These requests can be initiated in your code or through the internal control engine. The RegistryAccessPolicy
allows you to apply global registry access restrictions, or track user/app initiated requests and execute custom actions in response.
Call one of the following methods at application startup to apply a restrictive policy:
- SuppressAllOperations() – Suppresses all requests to the system registry.
- SuppressReadOperations() – Suppresses read requests from the system registry.
- SuppressWriteOperations() – Suppresses requests to write to the system registry.
- ThrowAlways() – Throws an exception when the control accesses the system registry.
- ThrowOnErrors() – Throws an exception if a request to the system registry fails.
The following example suppresses all read/write requests to the system registry:
static void Main() {
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
DevExpress.Data.Utils.RegistryAccessPolicy.SuppressAllOperations();
Application.Run(new Form1());
}
Use the AllowOperation method to allow a specific registry operation.
Handle SetValue, QueryValue, EnumerateSubKeyTree, DeleteSubKeyTree events to allow or cancel registry operations based on a specific condition.
Tip
Read the following topic for additional information: Registry Access Policy.