Back to Devexpress

AsyncDownloadPolicy.Probing Event

corelibraries-devexpress-dot-data-dot-asyncdownloadpolicy-3aeaef4d.md

latest3.5 KB
Original Source

AsyncDownloadPolicy.Probing Event

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

Declaration

csharp
public static event AsyncDownloadPolicy.WeakEventHandler<AsyncDownloadPolicy.ProbingEventArgs> Probing
vb
Public Shared Event Probing As AsyncDownloadPolicy.WeakEventHandler(Of AsyncDownloadPolicy.ProbingEventArgs)

Event Data

The Probing event's data class is AsyncDownloadPolicy.ProbingEventArgs. The following properties provide information specific to this event:

PropertyDescription
CancelGets or sets a value indicating whether the event should be canceled. Inherited from CancelEventArgs.
IsTrustedUriGets whether the processed resource is in a “safe” resource whitelist. Inherited from AsyncDownloadPolicy.AsyncDownloaderCancelEventArgs.
ThrowOnNonTrustedUriGets or sets whether to throw an exception for unwanted download requests. Inherited from AsyncDownloadPolicy.AsyncDownloaderCancelEventArgs.
UriGets the processed resource identifier. Inherited from AsyncDownloadPolicy.AsyncDownloaderCancelEventArgs.

Remarks

csharp
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;
}
vb
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

AsyncDownloadPolicy Class

AsyncDownloadPolicy Members

DevExpress.Data Namespace