ProcessStartPolicy.RestrictedProcessStartConfirmationEventArgs.BlockStart() Method
Explicitly blocks the process from starting.
Namespace: DevExpress.Data.Utils
Assembly: DevExpress.Data.Desktop.v25.2.dll
NuGet Packages: DevExpress.Data.Desktop, DevExpress.ExpressApp.Win.Design
Declaration
Remarks
Call the BlockStart method in a ConfirmationRequest event handler to prevent execution and suppress the confirmation dialog.
The following example enables the RequireConfirmation() policy at application startup and handles the ConfirmationRequest event to implement custom validation logic. The event handler allows only HTTPS URLs and blocks all other process start requests without displaying the confirmation dialog.
using DevExpress.Data.Utils;
internal static class Program {
[STAThread]
static void Main() {
// Apply the RequireConfirmation policy.
ProcessStartPolicy.RequireConfirmation();
ProcessStartPolicy.ConfirmationRequest += ProcessStartPolicy_ConfirmationRequest;
ApplicationConfiguration.Initialize();
Application.Run(new Form1());
}
// Allow only HTTPS URLs.
static void ProcessStartPolicy_ConfirmationRequest(object? sender, ProcessStartPolicy.RestrictedProcessStartConfirmationEventArgs e) {
if (e.Uri != null)
if (e.Uri.Scheme == Uri.UriSchemeHttps)
e.AllowStart(); // Safe URL — allow execution
else
e.BlockStart(); // Non-HTTPS — block execution
}
}
See Also