corelibraries-devexpress-dot-data-dot-utils-dot-registryaccesspolicy-dot-allowoperation-x28-devexpress-dot-data-dot-utils-dot-registry-dot-internal-dot-registryoperation-x29.md
Enables the specified registry operation.
Namespace : DevExpress.Data.Utils
Assembly : DevExpress.Data.Desktop.v25.2.dll
NuGet Packages : DevExpress.Data.Desktop, DevExpress.ExpressApp.Win.Design
public static void AllowOperation(
RegistryOperation operation
)
Public Shared Sub AllowOperation(
operation As RegistryOperation
)
| Name | Type | Description |
|---|---|---|
| operation | DevExpress.Data.Utils.Registry.Internal.RegistryOperation |
The registry operation.
|
Use the AllowOperation method to enable a specific registry operation when a restrictive policy is activated.
Registry operations include:
RegistryOperation.QueryValueRegistryOperation.SetValueRegistryOperation.DeleteSubKeyTreeRegistryOperation.EnumerateSubKeyTreeRegistryOperation.AllRegistryOperation.NoneThe following example suppresses all registry-related operations except for read requests from the system registry:
using System;
using System.Windows.Forms;
using DevExpress.Data.Utils;
using DevExpress.Data.Utils.Registry.Internal;
namespace DXApplication {
internal static class Program {
[STAThread]
static void Main() {
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
RegistryAccessPolicy.SuppressAllOperations();
RegistryAccessPolicy.AllowOperation(RegistryOperation.EnumerateSubKeyTree);
RegistryAccessPolicy.AllowOperation(RegistryOperation.QueryValue);
Application.Run(new Form1());
}
}
}
using System;
using System.Windows.Forms;
using DevExpress.Data.Utils;
using DevExpress.Data.Utils.Registry.Internal;
namespace DXApplication {
internal static class Program {
[STAThread]
static void Main() {
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
RegistryAccessPolicy.SuppressAllOperations();
RegistryAccessPolicy.AllowOperation(RegistryOperation.EnumerateSubKeyTree);
RegistryAccessPolicy.AllowOperation(RegistryOperation.QueryValue);
Application.Run(new Form1());
}
}
}
Tip
Use the IsOperationAllowed method to check whether the specified registry operation is allowed.
Read the following topic for additional information: Registry Access Policy.
See Also