I would handle this by creating a public event in the module:
Public Event ChangeOccured(<variables to let the node class know what is going on>)
then when declaring the node class you should pass the network object to it byref and add a handler in the new function:
AddHandler NetworkModule.ChangeOccured, Addressof HandlingFunction
You'll of course need to create the function as such:
Private Sub HandlingFunction(<same params as in the ChangeOccured event declaration>)
<code>
End Sub
~~~~~~~~~~~~~~~~~~~~~~~~~Edit 1~~~~~~~~~~~~~~~~~~~~~~~~~~~
If your file system watcher module isn't a class yet, I would consider making it one.
~~~~~~~~~~~~~~~~~~~~~~~~~Edit 2: 11/23/2009 3:30 PM~~~~~~~~~~~~~~~~~~~~~~~~~~~
There are four steps to creating and using a custom event in .NET which I've displayed above. I will break them down for you here:
Step 1: Declare the custom event in your class so that other code can latch onto it and create handlers for it.
Public Event ChangeOccured(<variables to let the node class know what is going on>)
Step 2: Actually make your class raise the event so that anything that is attached to it gets fired.
RaiseEvent ChangeOccured(<variables of the same type declared in step 1 go here>)
Step 3: Create a function outside the class (wherever you need it) that needs to be called when an event fires.
Private Sub HandlingFunction(<same params as in the ChangeOccured event declaration>)
<code>
End Sub
Step 4: Attach the function to the event that will happen when it gets raised from other classes. You do this on formload or after the class is instantiated.
AddHandler NetworkModule.ChangeOccured, Addressof HandlingFunction
Its really a simple process after you understand what exactly it does. Once you understand those four steps, you begin to realize that all of .NET form objects are actually written this way and that there are really a lot of tricks you can do with event handlers and form objects that you couldn't do otherwise.