ProcessStartPolicy.Starting Event
Fires before a process starts and allows you to cancel the process.
Namespace: DevExpress.Data.Utils
Assembly: DevExpress.Data.Desktop.v24.2.dll
Declaration
Event Data
The Starting event's data class is CancelEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
Cancel | Gets or sets a value indicating whether the event should be canceled. |
Remarks
Handle Starting
and Started events to perform custom actions when a DevExpress UI control starts a process.
static void Main() {
ProcessStartPolicy.Starting += ProcessStartPolicy_Starting;
ProcessStartPolicy.Started += ProcessStartPolicy_Started;
// ...
}
private static void ProcessStartPolicy_Starting(object sender, System.ComponentModel.CancelEventArgs e) {
ProcessStartInfo psi = sender as ProcessStartInfo;
e.Cancel = !psi.FileName.Contains("www.devexpress.com");
}
private static void ProcessStartPolicy_Started(object sender, EventArgs e) {
Process process = sender as Process;
// ...
// Log.WriteMessage("process started");
}
Read the following topic for more information: Suppress New Processes Initiated by .NET Controls.
See Also