.

Assertion Events

Declaration

 
Delegate Sub
Mpx.Global.AssertionDelegate(file As String, line As UInt32, condition As String) Public Shared Event Mpx.Global.AssertionEvent(file As String, line As UInt32, condition As String)

Description

AssertEvent is invoked when an internal MPX assertion occurs. After AssertionEvent has been invoked, an exception of type Mpx.AssertException is thrown.

AssertionEvent accepts delegates whose signatures match AssertionDelegate.

 
file The source file where the assertion occurred.
line The line where the assertion occurred.
condition A text representation of the of the condition that failed.

Sample Code

The following code sets up an delegate to log MPX library assertions to a file using an undefined function LogToFile that takes a single argument of type String.

 

Public Sub MpxAssertHandler(ByVal file As String, 
                            ByVal line As UInt32, 
                            ByVal condition As String)
LogToFile("Exception as " + file + ":" + line.ToString() + ". Condition: " + condition) End Sub Private Sub Form_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) _Handles MyBase.Load
AddHandler mpx.Global.AssertionEvent, AddressOf Me.MpxAssertHandler
End Sub

See Also

MPX Error Handling

Mpx.AssertException

 

       Legal Notice  |  Tech Email  |  Feedback
      
Copyright ©
2001-2021 Motion Engineering