Skip to main content
All docs
V25.1
  • RegistryAccessPolicy.AllowOperation(RegistryOperation) Method

    Enables the specified registry operation.

    Namespace: DevExpress.Data.Utils

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

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

    Declaration

    public static void AllowOperation(
        RegistryOperation operation
    )

    Parameters

    Name Type Description
    operation DevExpress.Data.Utils.Registry.Internal.RegistryOperation

    The registry operation.

    Remarks

    Use the AllowOperation method to enable a specific registry operation when a restrictive policy is activated.

    Registry operations include:

    • RegistryOperation.QueryValue
    • RegistryOperation.SetValue
    • RegistryOperation.DeleteSubKeyTree
    • RegistryOperation.EnumerateSubKeyTree
    • RegistryOperation.All
    • RegistryOperation.None

    The 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());
            }
        }
    }
    

    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