corelibraries-devexpress-dot-data-dot-utils-dot-processstartpolicy-dot-processstartfailedexceptioneventargs-365defe2.md
Gets or sets whether to throw an exception.
Namespace : DevExpress.Data.Utils
Assembly : DevExpress.Data.Desktop.v25.2.dll
NuGet Packages : DevExpress.Data.Desktop, DevExpress.ExpressApp.Win.Design
public bool Throw { get; set; }
Public Property [Throw] As Boolean
| Type | Description |
|---|---|
| Boolean |
true to throw an exception; otherwise, false.
|
The following example demonstrates how to suppress an internal exception and display a message box:
static void Main() {
DevExpress.Data.Utils.ProcessStartPolicy.Failed += ProcessStartPolicy_Failed;
//...
}
private static void ProcessStartPolicy_Failed(object sender, DevExpress.Data.Utils.ProcessStartPolicy.ProcessStartFailedExceptionEventArgs e) {
if(e.Exception is Win32Exception) {
System.Diagnostics.ProcessStartInfo si = sender as System.Diagnostics.ProcessStartInfo;
e.Throw = false;
MessageBox.Show("File not found: " + si.FileName);
}
}
Public Class Form1
Shared Sub Main()
AddHandler DevExpress.Data.Utils.ProcessStartPolicy.Failed, AddressOf ProcessStartPolicy_Failed
Application.EnableVisualStyles()
Application.SetCompatibleTextRenderingDefault(False)
Application.Run(New Form1)
End Sub
Private Shared Sub ProcessStartPolicy_Failed(ByVal sender As Object, ByVal e As DevExpress.Data.Utils.ProcessStartPolicy.ProcessStartFailedExceptionEventArgs)
If TypeOf e.Exception Is Win32Exception Then
Dim si As System.Diagnostics.ProcessStartInfo = TryCast(sender, System.Diagnostics.ProcessStartInfo)
e.Throw = False
MessageBox.Show("File not found: " & si.FileName)
End If
End Sub
End Class
See Also
ProcessStartPolicy.ProcessStartFailedExceptionEventArgs Class
ProcessStartPolicy.ProcessStartFailedExceptionEventArgs Members