corelibraries-devexpress-dot-data-d71ee7a7.md
Allows you to spot, analyze, and prohibit unwanted download requests.
Namespace : DevExpress.Data
Assembly : DevExpress.Data.v25.2.dll
NuGet Package : DevExpress.Data
public static class AsyncDownloadPolicy
Public Module AsyncDownloadPolicy
Certain DevExpress UI controls can download data over the internet. These requests can be initiated in your code or through the internal control engine. The AsyncDownloadPolicyallows you to apply global download restrictions, create a “safe” resource whitelist, or track user/app initiated downloads and execute custom actions in response.
Call one of the following methods at application startup to apply a restrictive policy:
SuppressAll() – Suppresses all downloads.
ThrowAlways() – Throws an exception when a control initiates a download.
static void Main() {
DevExpress.Data.AsyncDownloadPolicy.SuppressAll();
DevExpress.Data.AsyncDownloadPolicy.RegisterTrustedUri(new Uri("https://www.devexpress.com"));
Application.Run(new Form1());
}
Shared Sub Main()
DevExpress.Data.AsyncDownloadPolicy.SuppressAll()
DevExpress.Data.AsyncDownloadPolicy.RegisterTrustedUri(New Uri("https://www.devexpress.com"))
Application.Run(New Form1())
End Sub
Read the following topic for detailed information and examples: Suppress Control Requests to Download Data from External URLs.
Object AsyncDownloadPolicy
See Also