Skip to main content

UrlAccessSecurityLevelSetting.RegisterCustomCallback(Func<String, Uri>) Method


Use the DevExpress.Security.Resources.AccessSettings.StaticResources.TrySetRules method instead.

Enables loading images to the protocols defined in the specified callback.

Namespace: DevExpress.Utils

Assembly: DevExpress.Data.v22.2.dll

NuGet Package: DevExpress.Data


[Obsolete("Use the DevExpress.Security.Resources.AccessSettings.StaticResources.TrySetRules method instead.")]
public static bool RegisterCustomCallback(
    Func<string, Uri> customCallback


Name Type Description
customCallback Func<String, Uri>

A function, specifying a custom callback.


Type Description

true, if loading images to custom directories is enabled; otherwise, false.


On calling this method, the UrlAccessSecurityLevelSetting.SecurityLevel property becomes set to UrlAccessSecurityLevel.Custom.

This method returns false if registering custom protocols has failed (for example, if another directory has already been specified by the Document Viewer).

To forbid loading images, a custom callback must return null (Nothing in Visual Basic).

The following code illustrates how to use this method.

UrlAccessSecurityLevelSetting.RegisterCustomCallback((string url) => {
  if(!url.StartsWith("https://")) {
    return null;
  return new Uri(url);
See Also