Back to Devexpress

RegistryAccessPolicy.ThrowOnErrors() Method

corelibraries-devexpress-dot-data-dot-utils-dot-registryaccesspolicy-5caecdad.md

latest1.9 KB
Original Source

RegistryAccessPolicy.ThrowOnErrors() Method

Throws an exception if a read/write request to the system registry fails.

Namespace : DevExpress.Data.Utils

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

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

Declaration

csharp
public static void ThrowOnErrors()
vb
Public Shared Sub ThrowOnErrors

Remarks

Call the ThrowOnErrors method at application startup to apply a restrictive policy:

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

Read the following topic for additional information: Registry Access Policy.

See Also

ThrowAlways()

Failed

RegistryAccessPolicy Class

RegistryAccessPolicy Members

DevExpress.Data.Utils Namespace