Back to Devexpress

WinApplication.HandleException(Exception) Method

expressappframework-devexpress-dot-expressapp-dot-win-dot-winapplication-dot-handleexception-x28-system-dot-exception-x29.md

latest6.4 KB
Original Source

WinApplication.HandleException(Exception) Method

Shows the message box with details on the specified exception.

Namespace : DevExpress.ExpressApp.Win

Assembly : DevExpress.ExpressApp.Win.v25.2.dll

NuGet Packages : DevExpress.ExpressApp.Win, DevExpress.ExpressApp.Win.Design

Declaration

csharp
public void HandleException(
    Exception e
)
vb
Public Sub HandleException(
    e As Exception
)

Parameters

NameTypeDescription
eException

A System.Exception object representing an exception that occurred.

|

Remarks

Triggers the WinApplication.CustomHandleException event. If the event’s Handled parameter is not set to true , the message box is displayed via the Messaging.Show method (an overload that takes the caption and exception parameters is used).

The HandleException method is called each time an exception occurs when running a Windows Forms application (see the snippet from the Program.Main method below).

csharp
static void Main() {
    // ...
   try {
        winApplication.Setup();
        winApplication.Start();
    }
    catch (Exception e) {
        winApplication.HandleException(e);
    }
}

The following code snippets (auto-collected from DevExpress Examples) contain references to the HandleException(Exception) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

xaf-how-to-create-and-setup-an-xtrareport-report-for-exporting-to-a-stream-in-a-non-xaf/CS/ExportReportDemoEF/ExportReportDemoEF.Win/Program.cs#L40

csharp
catch(Exception e) {
    winApplication.HandleException(e);
}

XAF-implement-custom-permission-role-and-user-objects/CS/SecuredExportExample.Win/Program.cs#L54

csharp
catch (Exception e) {
    winApplication.HandleException(e);
}

XAF_how-to-add-custom-buttons-actions-to-the-lookup-and-popup-windows/CS/WinSolution.Win/Program.cs#L32

csharp
} catch (Exception e) {
    _application.HandleException(e);
}

xaf-how-to-import-data-in-xaf/CS/WinWebSolution.Win/Program.cs#L32

csharp
} catch (Exception e) {
    winApplication.HandleException(e);
}

xaf-how-to-implement-a-custom-attribute-to-customize-the-application-model/CS/DXExample.Win/Program.cs#L31

csharp
} catch (Exception e) {
    winApplication.HandleException(e);
}

xaf-how-to-create-and-setup-an-xtrareport-report-for-exporting-to-a-stream-in-a-non-xaf/VB/ExportReportDemoEF/ExportReportDemoEF.Win/Program.vb#L43

vb
Catch e As Exception
    winApplication.HandleException(e)
End Try

XAF-implement-custom-permission-role-and-user-objects/VB/SecuredExportExample.Win/Program.vb#L56

vb
Catch e As Exception
    winApplication.HandleException(e)
End Try

XAF_how-to-add-custom-buttons-actions-to-the-lookup-and-popup-windows/VB/WinSolution.Win/Program.vb#L31

vb
Catch e As Exception
    _application.HandleException(e)
End Try

xaf-how-to-import-data-in-xaf/VB/WinWebSolution.Win/Program.vb#L36

vb
Catch e As Exception
    winApplication.HandleException(e)
End Try

xaf-how-to-implement-a-custom-attribute-to-customize-the-application-model/VB/DXExample.Win/Program.vb#L34

vb
Catch e As Exception
    winApplication.HandleException(e)
End Try

See Also

WinApplication Class

WinApplication Members

DevExpress.ExpressApp.Win Namespace