Handling .Net events in C/AL
.NET components embedded in a NAV object can communicate with their host object by means of events that are handled by C/AL code. Events are raised by .NET components that invoke event handlers in NAV.
How to do it...
The FileSystemWatcher
component will be used to illustrate .NET events handling in C/SIDE. The component monitors changes in the filesystem and raises events in response to any file modification. These events will handled by a NAV object.
A new table will be required for the following demo to store data received from the
FileSystemWatcher
component. Open the table designer and create a table.Insert four fields in the table:
Field No.
Field Name
Data Type
Length
1
ID
Integer
2
Path
Text
250
3
Name
Text
100
4
Change Type
Option
Select the last field Change Type, open its properties and assign an option string: All, Changed, Created, Deleted, Renamed in the OptionString property.
Save the table as a new table
50210 Filesystem...