Skip to main content

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

OBSOLETE

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.v23.2.dll

NuGet Package: DevExpress.Data

Declaration

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

Parameters

Name Type Description
customCallback Func<String, Uri>

A function, specifying a custom callback.

Returns

Type Description
Boolean

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

Remarks

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