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

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

Namespace: DevExpress.Utils

Assembly: DevExpress.Data.v20.1.dll


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


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