Back to Devexpress

RegistryAccessPolicy Class

corelibraries-devexpress-dot-data-dot-utils-514164cf.md

latest3.7 KB
Original Source

RegistryAccessPolicy Class

Allows you to spot, analyze, and prohibit unwanted requests to the system registry.

Namespace : DevExpress.Data.Utils

Assembly : DevExpress.Data.Desktop.v25.2.dll

NuGet Packages : DevExpress.Data.Desktop, DevExpress.ExpressApp.Win.Design

Declaration

csharp
public static class RegistryAccessPolicy
vb
Public Module RegistryAccessPolicy

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:

The following example suppresses all read/write requests to the system registry:

csharp
static void Main() {
    Application.EnableVisualStyles();
    Application.SetCompatibleTextRenderingDefault(false);
    DevExpress.Data.Utils.RegistryAccessPolicy.SuppressAllOperations();
    Application.Run(new Form1());
}
vb
Shared Sub Main()
    Application.EnableVisualStyles()
    Application.SetCompatibleTextRenderingDefault(False)
    DevExpress.Data.Utils.RegistryAccessPolicy.SuppressAllOperations()
    Application.Run(New Form1())
End Sub

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.

Inheritance

Object RegistryAccessPolicy

See Also

RegistryAccessPolicy Members

DevExpress.Data.Utils Namespace