XafApplication.CustomCheckCompatibility Event
Occurs when trying to access the application’s database (when logging on or creating an Object Space).
Namespace: DevExpress.ExpressApp
Assembly: DevExpress.ExpressApp.v18.1.dll
Declaration
Event Data
The CustomCheckCompatibility event's data class is CustomCheckCompatibilityEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
ApplicationName | Specifies the application’s name. |
Handled | Gets or sets a value that indicates whether the event handler has completely handled the event or whether the system should continue its own processing. Inherited from HandledEventArgs. |
IsCompatibilityChecked | Indicates whether a compatibility check has already been performed. |
Modules | Lists all Modules used by the application. |
ObjectSpaceProvider | Specifies the Object Space Provider to be used for compatibility checking purposes. |
Remarks
The CustomCheckCompatibility event is raised as a result of the XafApplication.CheckCompatibility method call. Handle this event to perfom a custom check of the application and database compatibility, update the database, or any other action. Use the handler’s CustomCheckCompatibilityEventArgs.ApplicationName parameter, to compare the actual application name and the application name written in the database. To compare the actual versions of the application’s modules and the ones written in the database, use the handler’s CustomCheckCompatibilityEventArgs.Modules parameter. Use the CustomCheckCompatibilityEventArgs.ObjectSpaceProvider‘s methods to create a Session or an Object Space, to work with the database. Set the handler’s Handled parameter to true, to cancel executing default actions. By default, if the application is being run in the debugging mode, the XafApplication.DatabaseVersionMismatch event is raised. Otherwise, the database and application compatibility is checked. If the database cannot be opened or its version is older than the actual application version, the XafApplication.DatabaseVersionMismatch event is raised.
Note
The CustomCheckCompatibility event is raised many times. So, database-intensive checking should only be performed on the first compatibility check, when the CustomCheckCompatibilityEventArgs.IsCompatibilityChecked property returns false.
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CustomCheckCompatibility event.
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.