corelibraries-devexpress-dot-data-dot-asyncdownloadpolicy-3aeaef4d.md
Allows you to spot the probing of external resources before an actual attempt to download data.
Namespace : DevExpress.Data
Assembly : DevExpress.Data.v25.2.dll
NuGet Package : DevExpress.Data
public static event AsyncDownloadPolicy.WeakEventHandler<AsyncDownloadPolicy.ProbingEventArgs> Probing
Public Shared Event Probing As AsyncDownloadPolicy.WeakEventHandler(Of AsyncDownloadPolicy.ProbingEventArgs)
The Probing event's data class is AsyncDownloadPolicy.ProbingEventArgs. The following properties provide information specific to this event:
| Property | Description |
|---|---|
| Cancel | Gets or sets a value indicating whether the event should be canceled. Inherited from CancelEventArgs. |
| IsTrustedUri | Gets whether the processed resource is in a “safe” resource whitelist. Inherited from AsyncDownloadPolicy.AsyncDownloaderCancelEventArgs. |
| ThrowOnNonTrustedUri | Gets or sets whether to throw an exception for unwanted download requests. Inherited from AsyncDownloadPolicy.AsyncDownloaderCancelEventArgs. |
| Uri | Gets the processed resource identifier. Inherited from AsyncDownloadPolicy.AsyncDownloaderCancelEventArgs. |
void OnProbing(object sender, ProbingEventArgs e) {
var shouldClose = XtraMessageBox.Show("Notification",
"Probing the " + e.Uri.AbsoluteUri + " URL was detected. Close the connection?",
MessageBoxButtons.YesNo);
e.Cancel = (shouldClose == DialogResult.Yes) ? true : false;
}
Private Sub OnProbing(ByVal sender As Object, ByVal e As ProbingEventArgs)
Dim shouldClose = XtraMessageBox.Show("Notification", "Probing the " & e.Uri.AbsoluteUri & " URL was detected. Close the connection?", MessageBoxButtons.YesNo)
e.Cancel = If((shouldClose = DialogResult.Yes), True, False)
End Sub
Read the following topic for detailed information and examples: Suppress Control Requests to Download Data from External URLs.
See Also